Skip to content
Myr

custom-help-description

This file

Path

examples/custom-help-description

25 lines · 756 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 changing the flags and description for the help option.45// const { Command } = require('commander'); // (normal include)6const { Command } = require('../'); // include commander in git clone of commander repo7const program = new Command();89program10  .helpOption('-c, --HELP', 'custom help message')11  .option('-s, --sessions', 'add session support')12  .option('-t, --template <engine>', 'specify template engine', 'jade');1314program15  .command('child')16  .option('--gender', 'specific gender of child')17  .action((options) => {18    console.log('Childsubcommand...');19  });2021program.parse(process.argv);2223// Try the following:24//    node custom-help-description -c25//    node custom-help-description child --HELP