From 7478f3878207715177833a582292f00d3498065d Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Tue, 23 Aug 2022 11:30:01 -0400 Subject: [PATCH] added command line args to export to a PDF --- Program.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Program.cs b/Program.cs index d93bbc9..3430aad 100644 --- a/Program.cs +++ b/Program.cs @@ -7,7 +7,7 @@ static class Program var outputOption = new Option( "--output", "Specify the output given to the user" - ).FromAmong("stdout", "xlsx"); + ).FromAmong("stdout", "xlsx", "pdf"); outputOption.AddAlias("-o"); var branchOption = new Option( @@ -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);