Skip to content
Myr

custom-help

This file

Path

examples/custom-help

22 lines · 403 bytes

Last changed by

Reformat code with Prettier (#2180)John Geebefore adoption1bdc749

History of this file

Take it

The walk stopped after 200 commits: lines older than 3103c6b point at it.

Add more tests for implies (#1730)John Geebefore adoption3103c6b

lines 1–5why, one step back
1#!/usr/bin/env node
23// This example shows a simple use of addHelpText.4// This is used as an example in the README.5

Use standard import in examples (#2168)John Geebefore adoption41b12cf

line 6why, one step back
6const { Command } = require('commander');

Add more tests for implies (#1730)John Geebefore adoption3103c6b

lines 7–8why, one step back
7const program = new Command();
8

Reformat code with Prettier (#2180)John Geebefore adoption1bdc749

line 9why, one step back
9program.option('-f, --foo', 'enable some foo');

Add more tests for implies (#1730)John Geebefore adoption3103c6b

line 10why, one step back
10

Reformat code with Prettier (#2180)John Geebefore adoption1bdc749

lines 11–13why, one step back
11program.addHelpText(
12 'after',13 `

Add more tests for implies (#1730)John Geebefore adoption3103c6b

lines 14–15why, one step back
14
15Example call:

Reformat code with Prettier (#2180)John Geebefore adoption1bdc749

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

Add more tests for implies (#1730)John Geebefore adoption3103c6b

lines 18–22why, one step back
18
19program.parse(process.argv);2021// Try the following:22// node custom-help --help