Skip to content
Myr

custom-version

This file

Path

examples/custom-version

18 lines · 598 bytes

Last changed by

Make examples more consistent with "Try the following" (#1629)John Geebefore adoption2cc3a36

History of this file

Take it

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

Tidy up example now check for required command arguments (#1320)John Geebefore adoptionf47bdf5

lines 1–11why, one step back
1#!/usr/bin/env node
23// This example shows changing the flags and description for the version option.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', '-v, --VERSION', 'new version message')11 .option('-s, --sessions', 'add session support')

Tidy up some old examples (#1604)John Geebefore adoptionc1472bc

line 12why, one step back
12 .option('-t, --template <engine>', 'specify template engine', 'jade');

Tidy up example now check for required command arguments (#1320)John Geebefore adoptionf47bdf5

lines 13–14why, one step back
13
14program.parse(process.argv);

Tidy up some old examples (#1604)John Geebefore adoptionc1472bc

lines 15–16why, one step back
15
16// Try the following:

Make examples more consistent with "Try the following" (#1629)John Geebefore adoption2cc3a36

lines 17–18why, one step back
17// node custom-version -v
18// node custom-version --VERSION