-
-
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
exitOverride doesn't override call to process.exit #1444
Comments
This is intentional. Sorry you were confused. You can override the exit behaviour, but Commander code still expects the normal flow of execution to stop. The default behaviour for Hmm, maybe in the case the exit override returns it could throw instead. That might make it clearer that the |
I'd say it's probably the same either way - the use case for not exiting was testing, and handling an exception as part of a test of an error path seems like an entirely reasonable workaround. Thanks for the clarification! |
PS: Big fan of the library API/design overall. |
An answer was provided, and no further activity in a month. Closing this as resolved. Feel free to open a new issue if it comes up again, with new information and renewed interest. |
I'm running into an issue where exitOverride doesn't work the way I would expect it to based on documentation, though the behavior may be intended.
My assumption is that exitOverride would completely override the exit behavior of the
Command
, and that the provided callback would be called instead of callingprocess.exit
. Instead, the callback is called and then, if the callback does not throwprocess.exit
is called as well.Here's a minimal example that will demonstrate this
The issue seems to be this snippet
This looks like it should be an if-else.
If this is expected behavior, please close this (though it might be nice to update the documentation to cover this, since it confused the heck out of me).
The text was updated successfully, but these errors were encountered: