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 fileTake 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 back1#!/usr/bin/env node23// This example shows a simple use of addHelpText.4// This is used as an example in the README.5Switching to esm-only (#2464)John Geebefore adoptionf4bd470
line 6why, one step back6import { Command } from 'commander';Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 7–8why, one step back7const program = new Command();8Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
line 9why, one step back9program.option('-f, --foo', 'enable some foo');Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 10why, one step back10Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
lines 11–13why, one step back11program.addHelpText(12 'after',13 `Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 14–15why, one step back1415Example call:Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
lines 16–17why, one step back16 $ custom-help --help`,17);Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 18–22why, one step back1819program.parse(process.argv);2021// Try the following:22// node custom-help --help