Skip to content
This repository was archived by the owner on Jul 3, 2020. It is now read-only.

Commit ce8a56c

Browse files
authored
Merge pull request #12 from pamidur/exit-codes
Added exit code 1 when cmd line not parsed correctly
2 parents 7402c5a + 61b87d9 commit ce8a56c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Program.cs

100644100755
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ namespace Codacy.CSharpCoverage
1010
{
1111
internal class Program
1212
{
13-
private static void Main(string[] args)
13+
private static int Main(string[] args)
1414
{
15+
int exitcode = 0;
16+
1517
// parse the option arguments
1618
Parser.Default.ParseArguments<Options>(args)
1719
.WithParsed(opt =>
@@ -54,7 +56,10 @@ private static void Main(string[] args)
5456

5557
SendReport(report, opt.CommitUUID, opt.Token, opt.Partial);
5658
}
57-
});
59+
})
60+
.WithNotParsed(errs => exitcode = 1);
61+
62+
return exitcode;
5863
}
5964

6065
/// <summary>

0 commit comments

Comments
 (0)