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

No warning when incorrect options are passed with changed parameters order #125

Closed
GoalSmashers opened this issue Feb 9, 2013 · 5 comments

Comments

@GoalSmashers
Copy link

Let's take the following code (assume file is named demo.js).

#!/usr/bin/env node

var commands = require('commander');

commands
  .option('-t, --test <value>', 'Just testing')
  .parse(process.argv);

Let's try to run it:
./demo.js --test 5 - no errors
./demo.js --test 5 demo.js - no errors
./demo.js --test 5 --test2 demo.js - unknown option '--test2'
./demo.js demo.js --test 5 --test2 - no errors

Apparently extra arguments where added at the beginning suppress errors.

@nitoyon
Copy link

nitoyon commented Feb 10, 2013

This bug is fixed by my pull request #121.
I hope @visionmedia would merge it.

@GoalSmashers
Copy link
Author

Perfect, thanks a lot!

@nitoyon
Copy link

nitoyon commented Feb 10, 2013

If you aren't using command(), see this quick hack: nitoyon/livereloadx@5215812.
I'm avoiding this bug by using lower API of commander.js.

@GoalSmashers
Copy link
Author

That's a nice bit. We'll check that or maybe your patch will get pulled in the meantime. Thanks for sharing!

@shadowspawn
Copy link
Collaborator

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