title | category |
---|---|
Commander.js |
JavaScript libraries |
{: .-intro}
var cli = require('commander');
cli
.version(require('../package').version)
.usage('[options] <command>')
.option('-w, --words <n>', 'generate <n> words')
.option('-i, --interval <n>', 'interval [1000]', 1000)
.option('-s, --symbols', 'include symbols')
.parse(process.argv);
.on('--help', function() {
console.log('');
})
cli.outputHelp();
cli.args == ["hello"];
process.exit(0);