3 category: JavaScript libraries
10 var argv = require('yargs').argv;
13 argv.$0 // "node bin/mybin"
14 argv.verbose // --verbose
20 var argv = require('yargs')
23 .alias('v', 'version')
24 .version(function() { return require('../package').version; })
25 .describe('v', 'show version information')
30 .usage('Usage: $0 -x [num]')
31 .showHelpOnFail(false, "Specify --help for available options")
39 describe: 'x marks the spot',
40 type: 'string', /* array | boolean | string */
43 demand: 'file is required',
44 default: '/etc/passwd'
45 // also: count:true, requiresArg:true
53 ### Examples and more help stuff
58 .epilog('copyright 2015')
59 .command('start', 'start a server')
67 argv.verbose // -vvv => 3
70 ### Reject non explicits
80 yargs.help() //=>string