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
The walk stopped after 200 commits: lines older than 25b06ee point at it.
version bump 2.17.0abetomobefore adoption25b06ee
lines 1–2why, one step back1#!/usr/bin/env node2Merge branch 'develop' into release/5.xJohn Geebefore adoption491b2e4
lines 3–4why, one step back3// const program = require('commander'); // (normal include)4const program = require('../'); // include commander in git clone of commander repoversion bump 2.17.0abetomobefore adoption25b06ee
lines 5–13why, one step back56function 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')Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98
line 14why, one step back14 .option('-l, --list [items]', 'Specify list items defaulting to 1,2,3', list, [1, 2, 3])version bump 2.17.0abetomobefore adoption25b06ee
lines 15–19why, one step back15 .parse(process.argv);1617console.log(' - %s template engine', program.templateEngine);18console.log(' - %s cheese', program.cheese);19console.log(' - %j', program.list);