You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to setup a cli with git style subcommands. Hence, created these files:
test.js
test-foo.js
test-bar.js
In my test.js, where I define the app, if I set the command description:
program
.version('1.0.0')
.command('foo', 'foo action')
.command('bar', 'bar action')
.parse(process.argv);
Everything works as expected:
$ node dist/test.js --help
Usage: test [options] [command]
Commands:
foo foo action
bar bar action
help [cmd] display help for [cmd]
Options:
-h, --help output usage information
-V, --version output the version number
Yet at first I omitted the description for the test case:
program
.version('1.0.0')
.command('foo')
.command('bar')
.parse(process.argv);
and then only the bar command seems added:
node dist/test.js --help
Usage: bar [options]
Options:
-h, --help output usage information
As a developer I find that counter-intuitive and would have expected an error to be thrown in my face or for the two commands to be added with or without description.
The text was updated successfully, but these errors were encountered:
I wanted to setup a cli with git style subcommands. Hence, created these files:
test.js
test-foo.js
test-bar.js
In my
test.js
, where I define the app, if I set the command description:Everything works as expected:
Yet at first I omitted the description for the test case:
and then only the bar command seems added:
As a developer I find that counter-intuitive and would have expected an error to be thrown in my face or for the two commands to be added with or without description.
The text was updated successfully, but these errors were encountered: