Skip to content
Myr

custom-help-description

This file

Path

examples/custom-help-description

24 lines · 640 bytes

Last changed by

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

History of this file

Take it

1#!/usr/bin/env node23// This example shows changing the flags and description for the help option.45import { Command } from 'commander';6const program = new Command();78program9  .helpOption('-c, --HELP', 'custom help message')10  .option('-s, --sessions', 'add session support')11  .option('-t, --template <engine>', 'specify template engine', 'jade');1213program14  .command('child')15  .option('--gender', 'specific gender of child')16  .action((options) => {17    console.log('Childsubcommand...');18  });1920program.parse(process.argv);2122// Try the following:23//    node custom-help-description -c24//    node custom-help-description child --HELP