Skip to content
Myr

custom-help

This file

Path

examples/custom-help

22 lines · 398 bytes

Last changed by

Switching to esm-only (#2464)John Geebefore adoptionf4bd470

History of this file

Take it

The walk stopped after 200 commits: lines older than 471ec40 point at it.

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

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

Switching to esm-only (#2464)John Geebefore adoptionf4bd470

line 6why, one step back
6import { Command } from 'commander';

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

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 copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

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 copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

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 copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

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