Skip to content

Commit

Permalink
Added error exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
tymbaca committed Jun 14, 2023
1 parent 90a7a01 commit 14a8e67
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@ public class Options

static public void Main(string[] args)
{
Parser.Default.ParseArguments<Options>(args).WithParsed<Options>(o => {
var parseResult = Parser.Default.ParseArguments<Options>(args).WithParsed<Options>(o => {
// Console.Write(String.Join(", ", o.filenames));
File.Delete(o.OutputFilename);
var merger = new FileMerger(o.OutputFilename, o.Filenames, o.SetPageBreaks);
// merger.MergeFiles();
merger.MergeFiles();
});
if (parseResult.Errors.Count() == 0) {
Environment.Exit(0);
} else {
Environment.Exit(1);
}
}
}

Expand Down

0 comments on commit 14a8e67

Please sign in to comment.