-
Notifications
You must be signed in to change notification settings - Fork 441
Closed
Milestone
Description
Commonly, successful execution of a command should result in a zero exit code and unsuccessful invocation should result in a non-zero exit code.
The java
executable does not return a non-zero exit code if the application exits because of an uncaught throwable. It’s up to the application to call System.exit(int)
if control over the exit code is desired.
Picocli has a “success” path and three separate “failure” paths:
- InitializationException if misconfigured
- ParameterException if user input is invalid
- ExecutionException if user input was valid but the IParseResultHandler threw an exception
- No errors
Consider providing API to let applications control the exit code for all of the above.
See also discussion under #218 for API ideas on how to accomplish this.
ppussar