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

1#!/usr/bin/env node23// 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')12  .option('-t, --template <engine>', 'specify template engine', 'jade');1314program.parse(process.argv);1516// Try the following:17//    node custom-version -v18//    node custom-version --VERSION