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

1#!/usr/bin/env node23// This example shows a simple use of addHelpText.4// This is used as an example in the README.56// const { Command } = require('commander'); // (normal include)7const { Command } = require('../'); // include commander in git clone of commander repo8const program = new Command();910program11  .option('-f, --foo', 'enable some foo');1213program.addHelpText('after', `1415Example call:16  $ custom-help --help`);1718program.parse(process.argv);1920// Try the following:21//    node custom-help --help