added command line args to export to a PDF

This commit is contained in:
Wyatt J. Miller 2022-08-23 11:30:01 -04:00
parent ddabd6080f
commit 7478f38782

View File

@ -7,7 +7,7 @@ static class Program
var outputOption = new Option<string>(
"--output",
"Specify the output given to the user"
).FromAmong("stdout", "xlsx");
).FromAmong("stdout", "xlsx", "pdf");
outputOption.AddAlias("-o");
var branchOption = new Option<string>(
@ -59,6 +59,22 @@ static class Program
break;
}
break;
case "pdf":
PdfDataService pdfDataService = new PdfDataService();
DataAccess dataAccessPdfCase = new DataAccess(pdfDataService);
switch (branchOptionValue)
{
case null:
commits.GetCurrentCommitsByName();
dataAccessPdfCase.WriteData(commits.CommitDetails);
break;
default:
commits.GetCommitsByBranch(branchOptionValue);
dataAccessPdfCase.WriteData(commits.CommitDetails);
break;
}
break;
case null:
StdOutDataService stdOutDataService = new StdOutDataService();
DataAccess dataAccessNullCase = new DataAccess(stdOutDataService);