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
yargs(hideBin(process.argv)).command('serve [port]','Start the server',(yargs)=>yargs.positional('port',{describe: 'Port to bind on',default: 8080})).alias('v','version').version().option('verbose',{type: 'boolean',description: 'Run with verbose logging'}).args
When I run my app w/ --help I get the following:
index.js [command]
Commands:
index.js serve [port] start the server
Options:
--help Show help [boolean]
--verbose Run with verbose logging [boolean]
-v, --version Show version number [boolean]
Process finished with exit code 0
My question is: How do I get the default 8080 for the port argument to be printed into the help output?
$ node ./examples/pizza --help
Usage: pizza [options]
An application for pizza ordering
Options:
-p, --peppers Add peppers
-c, --cheese <type> Add the specified type of cheese (default: "marble")
-C, --no-cheese You do not want any cheese
-h, --help display helpforcommand
The text was updated successfully, but these errors were encountered:
I have the following
yargs
configuration:When I run my app w/
--help
I get the following:My question is: How do I get the default
8080
for theport
argument to be printed into the help output?I'd like to see an output similar to the
(default:[value])
given from thecommand.js
package: https://github.com/tj/commander.js#automated-helpThe text was updated successfully, but these errors were encountered: