custom-help
This file
Path
examples/custom-help
28 lines · 539 bytes
Last changed by
remove unused list function from custom-help exampleDrew Fyockbefore adoptiona1cc98c
History of this fileTake it
Added support for custom --help outputTj Holowaychukbefore adoptionda13783
lines 1–27why, one step back1#!/usr/bin/env node23/**4 * Module dependencies.5 */67var program = require('../');89program10 .version('0.0.1')11 .option('-f, --foo', 'enable some foo')12 .option('-b, --bar', 'enable some bar')13 .option('-B, --baz', 'enable some baz');1415// must be before .parse() since16// node's emit() is immediate1718program.on('--help', function(){19 console.log(' Examples:');20 console.log('');21 console.log(' $ custom-help --help');22 console.log(' $ custom-help -h');23 console.log('');24});2526program.parse(process.argv);27fix .usage() when args are present. Closes #106TJ Holowaychukbefore adoptione52a321
line 28why, one step back28program.help();