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

requiredOption make --help invalid #1097

Closed
456wyc opened this issue Nov 14, 2019 · 2 comments
Closed

requiredOption make --help invalid #1097

456wyc opened this issue Nov 14, 2019 · 2 comments

Comments

@456wyc
Copy link

456wyc commented Nov 14, 2019

when i set requiredOption on program, the --help will noneffective:

const program = new commander.Command()
program.version('0.0.1')
program
  .requiredOption('-d, --dir <path>', 'dir path')
  .option('-t, --timeout <number>', 'timeout')

when use -h, will get a error, but not the help info:

$ ./app.js -h
error: required option '-d, --dir <path>' not specified
@shadowspawn
Copy link
Collaborator

Try updating to Commander v4.0.1, which fixes that issue (#1089 #1091).

https://github.com/tj/commander.js/releases/tag/4.0.1

@456wyc
Copy link
Author

456wyc commented Nov 14, 2019

@shadowspawn thank you !

@456wyc 456wyc closed this as completed Nov 14, 2019
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