-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Triage: Exit #945
Comments
Yes, please simply throw errors. The outer program can catch the errors and handle them properly. |
I think being able to opt-in to using a throw makes good sense. But I think it is a bit untidy for default handling of expected errors with the source line number and code? Compared with just a message intended for humans. |
To be backward compatible, we can add an option to: like this: |
I am experimenting with a routine to optionally replace calls to
The custom error has properties for
I'm currently just replacing the call to |
There are improvements on the develop branch for the next release (#1040). |
v4.0.0-0 prerelease published: #1067 |
v4.0.0 has been released. It does not cover all the exit related issues found in triage, but addresses the most common issue of the unconditional call to exit. Feel free to open a new issue if still issues, with new information and renewed interest. |
Commander calls
exit
under various circumstances, such as after displaying an error or the help. This is pretty convenient for the caller of a one-shot parse in a CLI, but is a problem when Commander is being used as part of a long running program or if caller wants more control over the failure handling.Issues:
Pull Requests:
The text was updated successfully, but these errors were encountered: