Skip to content
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

Explicitly return when an error occurs #443

Closed
plemarquand opened this issue Sep 30, 2015 · 3 comments
Closed

Explicitly return when an error occurs #443

plemarquand opened this issue Sep 30, 2015 · 3 comments

Comments

@plemarquand
Copy link

Methods that rely on error methods (such as unknownOption, missingArgument, etc...) use process.exit() to stop execution and exit the program. This is quite inconvenient if you want to use Commander in a context other than a shell.

If a client extends the Command prototype to avoid having these error methods call process.exit(), command execution continues and commander blows up.

Personally I am using commander to parse arguments for my Slack bot, extending Command to prevent process.exit()s but even still if you input an incorrect command the program will crash.

@SomeKittens
Copy link
Collaborator

Thanks for this! Can you write a few tests showing this code works?

@plemarquand
Copy link
Author

@SomeKittens Hi, I've updated the patch with some relevant tests.

@shadowspawn
Copy link
Collaborator

Referenced from #945

This issue has not had any activity in over six months. It isn't likely to get acted on due to this report.

Feel free to open a new issue if it comes up again, with new information and renewed interest.

Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants