3 category: JavaScript libraries
9 var argv = require('yargs').argv;
12 argv.$0 // "node bin/mybin"
13 argv.verbose // --verbose
19 var argv = require('yargs')
22 .alias('v', 'version')
23 .version(function() { return require('../package').version; })
24 .describe('v', 'show version information')
29 .usage('Usage: $0 -x [num]')
30 .showHelpOnFail(false, "Specify --help for available options")
38 describe: 'x marks the spot',
39 type: 'string', /* array | boolean | string */
42 demand: 'file is required',
43 default: '/etc/passwd'
44 // also: count:true, requiresArg:true
52 ### Examples and more help stuff
57 .epilog('copyright 2015')
58 .command('start', 'start a server')
66 argv.verbose // -vvv => 3
69 ### Reject non explicits
79 yargs.help() //=>string