Skip to content
Myr

description

This file

Path

examples/description

18 lines · 559 bytes

Last changed by

Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b

History of this file

Take it

The walk stopped after 200 commits: lines older than 77ffd4f point at it.

Merge pull request #814 from DanielRuf/chore/cache-node-modulesTomoaki Abebefore adoption77ffd4f

lines 1–2why, one step back
1#!/usr/bin/env node
2

Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b

line 3why, one step back
3// This example shows adding a description which is displayed in the help.

Merge pull request #814 from DanielRuf/chore/cache-node-modulesTomoaki Abebefore adoption77ffd4f

line 4why, one step back
4

Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b

lines 5–8why, one step back
5// const { Command } = require('commander'); // (normal include)
6const { Command } = require('../'); // include commander in git clone of commander repo7const program = new Command();8

Merge pull request #814 from DanielRuf/chore/cache-node-modulesTomoaki Abebefore adoption77ffd4f

lines 9–13why, one step back
9program
10 .version('0.0.1')11 .description('Application simple description')12 .option('-f, --foo', 'enable some foo')13 .option('-b, --bar', 'enable some bar')

Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b

lines 14–16why, one step back
14 .option('-B, --baz', 'enable some baz');
1516program.parse(process.argv);

Merge pull request #814 from DanielRuf/chore/cache-node-modulesTomoaki Abebefore adoption77ffd4f

lines 17–18why, one step back
17
18if (!program.args.length) program.help();