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

Unknown options lead to program exiting silently without action #961

Closed
laurentseal opened this issue May 15, 2019 · 2 comments
Closed

Unknown options lead to program exiting silently without action #961

laurentseal opened this issue May 15, 2019 · 2 comments

Comments

@laurentseal
Copy link

laurentseal commented May 15, 2019

Commander version 2.13.0

Calling commander.js with an unknown option or an unknown command leads to the program exiting silently with an exit status of 0.

Ex.
./commanderjsbinary --option1 "argument1" --boolean-option-1 this-command-doesnt-exist cmd "cmdargs"

Note: The following example is minimal, but in bigger projects with existing options it causes the program to exit without warning if for example the user mistypes an argument. This behaviour is certainly unexpected.

A working minimal example:


const program = require('commander');

program.command('existingOption <argument>').description('bla').action(() => {
});

program.parse(process.argv);



@shadowspawn
Copy link
Collaborator

A previous issue which might cover your case is #561

@laurentseal
Copy link
Author

This seems to be a duplicate, ok

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

2 participants