rizsotto / scan-build

Clang's scan-build re-implementation in python
Other
362 stars 34 forks source link

Improve script exit codes #66

Closed gyorb closed 8 years ago

gyorb commented 8 years ago

If the scripts --help command was called the default 127 exit code was returned even if the call was successful. Setting the default exit code to 0 resolves this issue.

gyorb commented 8 years ago

I was thinking about my initial changes. It can be fixed without catching the SystemExit exception thrown by the argparse help but in that case the default exit code needs to be changed from 127 to 0. Is there any specific reason to use the 127 (command not found) value as the default exitcode?

gyorb commented 8 years ago

After doing some improvements for the #59 issue. I realized that the SystemExit exception still needed to be caught. If the sys.exit() is called in the source the exit code will not be set properly without it.

rizsotto commented 8 years ago

thank you!