Skip to content
Myr

description

This file

Path

examples/description

24 lines · 674 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 adding a description which is displayed in the help.45// const { Command } = require('commander'); // (normal include)6const { Command } = require('../'); // include commander in git clone of commander repo7const program = new Command();89program10  .version('0.0.1')11  .description('Application simple description')12  .option('-f, --foo', 'enable some foo')13  .option('-b, --bar', 'enable some bar')14  .option('-B, --baz', 'enable some baz');1516program.parse(process.argv);1718if (!program.args.length) program.help();1920// Try the following on macOS or Linux:21//    ./description -h22//23// Try the following:24//    node description -h