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
Try updating to Commander v4.0.1, which fixes that issue (#1089 #1091).
@shadowspawn thank you !
Most helpful comment
Try updating to Commander v4.0.1, which fixes that issue (#1089 #1091).
https://github.com/tj/commander.js/releases/tag/4.0.1