defaults
This file
Path
examples/defaults
19 lines · 691 bytes
Last changed by
Merge branch 'develop' into release/5.xJohn Geebefore adoption491b2e4
History of this fileTake it
1#!/usr/bin/env node23// const program = require('commander'); // (normal include)4const program = require('../'); // include commander in git clone of commander repo56function list(val) {7 return val.split(',').map(Number);8}910program11 .version('0.0.1')12 .option('-t, --template-engine [engine]', 'Add template [engine] support', 'jade')13 .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')14 .option('-l, --list [items]', 'Specify list items defaulting to 1,2,3', list, [1, 2, 3])15 .parse(process.argv);1617console.log(' - %s template engine', program.templateEngine);18console.log(' - %s cheese', program.cheese);19console.log(' - %j', program.list);