opts
Version:
Command line argument parser with automatic help text generation.
25 lines (19 loc) • 383 B
JavaScript
/**
* Simple example that is broken by design (conflicting options)
*
* Examples:
* $ node example3.js
* > Conflicting flags: -v
*/
var opts = require('..');
var options = [
{ short : 'v'
, description : 'Show version and exit'
},
{ short : 'v'
, description : 'Be verbose'
},
];
opts.parse(options);
console.log('Example 3');
process.exit(0);