Skip to content
Myr

custom-help

This file

Path

examples/custom-help

28 lines · 534 bytes

Last changed by

Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98

History of this file

Take it

1#!/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('');20  console.log('Examples:');21  console.log('');22  console.log('  $ custom-help --help');23  console.log('  $ custom-help -h');24});2526program.parse(process.argv);2728program.help();