Skip to content
Myr

custom-help

This file

Path

examples/custom-help

21 lines · 510 bytes

Last changed by

Make examples more consistent with "Try the following" (#1629)John Geebefore adoption2cc3a36

History of this file

Take 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 back
1#!/usr/bin/env node
2

Expand help customisation with .addHelpText (#1296)John Geebefore adoptiond26a26d

lines 3–4why, one step back
3// This example shows a simple use of addHelpText.
4// This is used as an example in the README.

Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b

lines 5–8why, one step back
5
6// const { Command } = require('commander'); // (normal include)7const { Command } = require('../'); // include commander in git clone of commander repo8const program = new Command();

update Readme_zh-CN.md for v5.0oGsLPbefore adoptionbdad7dc

lines 9–12why, one step back
9
10program11 .option('-f, --foo', 'enable some foo');12

Expand help customisation with .addHelpText (#1296)John Geebefore adoptiond26a26d

line 13why, one step back
13program.addHelpText('after', `

update Readme_zh-CN.md for v5.0oGsLPbefore adoptionbdad7dc

line 14why, one step back
14

Expand help customisation with .addHelpText (#1296)John Geebefore adoptiond26a26d

lines 15–17why, one step back
15Example call:
16 $ custom-help --help`);17

update Readme_zh-CN.md for v5.0oGsLPbefore adoptionbdad7dc

line 18why, one step back
18program.parse(process.argv);

Expand help customisation with .addHelpText (#1296)John Geebefore adoptiond26a26d

lines 19–20why, one step back
19
20// Try the following:

Make examples more consistent with "Try the following" (#1629)John Geebefore adoption2cc3a36

line 21why, one step back
21// node custom-help --help