custom-help-description
This file
Path
examples/custom-help-description
21 lines · 661 bytes
Last changed by
Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b
History of this fileTake it
Merge branch 'idmontie-feature/issue-47-add-version-help-message-override' into release/3.0.0John Geebefore adoptionafb8156
lines 1–2why, one step back1#!/usr/bin/env node2Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b
lines 3–7why, one step back3// 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();Merge branch 'idmontie-feature/issue-47-add-version-help-message-override' into release/3.0.0John Geebefore adoptionafb8156
lines 8–21why, one step back89program10 .helpOption('-c, --HELP', 'custom help message')11 .option('-s, --sessions', 'add session support')12 .option('-t, --template <engine>', 'specify template engine (jade|ejs) [jade]', 'jade');1314program15 .command('child')16 .option('--gender', 'specific gender of child')17 .action((cmd) => {18 console.log('Childsubcommand...');19 });2021program.parse(process.argv);