SharpGen icon indicating copy to clipboard operation
SharpGen copied to clipboard

Pass through the CommandLineApplication return code

Open dcsync opened this issue 6 years ago • 3 comments

Before applying this change SharpGen was always returning 0 on my system.

dcsync avatar Nov 12 '18 23:11 dcsync

Hey @dcsync, thanks for the pull! (And sorry for the delayed response)

I was playing around with this, and I am still always getting a 0 exit code, even with your changes. Could you provide an example of when this is not the case?

cobbr avatar Dec 12 '18 19:12 cobbr

bump @dcsync

cobbr avatar Mar 11 '19 20:03 cobbr

Hey @cobbr, does it return 0 on your system when invalid arguments are passed? Here's how I'm testing it:

$ dotnet --version
2.2.105
$ dotnet ./bin/Debug/netcoreapp2.1/SharpGen_original.dll ; echo "exit code: $?"
The --file field is required.
Specify --help for a list of available options and commands.
exit code: 0

Before returning the exit code of app.Execute() it would always return 0 on build failures and when invalid arguments were passed. After patching it I was able to get non-zero exit codes:

$ dotnet ./bin/Debug/netcoreapp2.1/SharpGen_patched.dll ; echo "exit code: $?"
The --file field is required.
Specify --help for a list of available options and commands.
exit code: 1

dcsync avatar Apr 22 '19 04:04 dcsync