description
This file
Path
examples/description
24 lines · 674 bytes
Last changed by
Make examples more consistent with "Try the following" (#1629)John Geebefore adoption2cc3a36
History of this fileTake it
The walk stopped after 200 commits: lines older than bdad7dc point at it.
update Readme_zh-CN.md for v5.0oGsLPbefore adoptionbdad7dc
lines 1–2why, one step back1#!/usr/bin/env node2Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b
line 3why, one step back3// This example shows adding a description which is displayed in the help.update Readme_zh-CN.md for v5.0oGsLPbefore adoptionbdad7dc
line 4why, one step back4Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b
lines 5–8why, one step back5// const { Command } = require('commander'); // (normal include)6const { Command } = require('../'); // include commander in git clone of commander repo7const program = new Command();8update Readme_zh-CN.md for v5.0oGsLPbefore adoptionbdad7dc
lines 9–13why, one step back9program10 .version('0.0.1')11 .description('Application simple description')12 .option('-f, --foo', 'enable some foo')13 .option('-b, --bar', 'enable some bar')Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b
lines 14–16why, one step back14 .option('-B, --baz', 'enable some baz');1516program.parse(process.argv);update Readme_zh-CN.md for v5.0oGsLPbefore adoptionbdad7dc
lines 17–18why, one step back1718if (!program.args.length) program.help();Make examples more consistent with "Try the following" (#1629)John Geebefore adoption2cc3a36
lines 19–24why, one step back1920// Try the following on macOS or Linux:21// ./description -h22//23// Try the following:24// node description -h