Skip to content
Myr

list example to defaults

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 5553ea0 · Browse files · 1 file+6 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−0 removed

  • other:+6 added−0 removed

1 file+6 added−0 removed

modified:examples/defaults+6 added
4 unmodified lines
5 */67var program = require('../');89function list(val) {10 return val.split(',').map(Number);11}1213program14 .version('0.0.1')15 .option('-t, --template-engine [engine]', 'Add template [engine] support', 'jade')16 .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')17 .option('-l, --list [items]', 'Specify list items defaulting to 1,2,3', list, [1,2,3])18 .parse(process.argv);1920console.log(' - %s template engine', program.templateEngine);21console.log(' - %s cheese', program.cheese);22console.log(' - %j', program.list);