Skip to content
Myr

Merge pull request #315 from zhiyelee/description

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Add application description Closed #112

authored by Zhiye Li · committed by Zhiye Li · parents 543e47f, 56276ec · Browse files · 2 files+49 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+49 added−10 removed

  • other:+49 added−10 removed

2 files+49 added−10 removed

added:examples/description+18 added
1#!/usr/bin/env node23/**4 * Module dependencies.5 */67var program = require('../');89program10 .version('0.0.1')11 .description('Application simple description')12 .option('-f, --foo', 'enable some foo')13 .option('-b, --bar', 'enable some bar')14 .option('-B, --baz', 'enable some baz')15 .parse(process.argv);1617if (!program.args.length) program.help();18
modified:index.js+31 added-10 removed
896 unmodified lines
897 * @api private898 */899900Command.prototype.helpInformation = function() {901 return [902 ''903 , ' Usage: ' + this._name904 + (this._alias905 ? '|' + this._alias906 : '')907 + ' ' + this.usage()908 , '' + this.commandHelp()909 , ' Options:'901 var desc = [];902 if (this._description) {903 desc = [904 ' ' + this._description905 , ''906 ];907 }908909 var cmdName = this._name;910 if(this._alias) {911 cmdName = cmdName + '|' + this._alias;912 }913 var usage = [914 ''915 ,' Usage: ' + cmdName + ' ' + this.usage()916 , ''917 ];918919 var cmds = [];920 var commandHelp = this.commandHelp();921 if (commandHelp) cmds = [commandHelp];922923 var options = [924 ' Options:'925 , ''926 , '' + this.optionHelp().replace(/^/gm, ' ')927 , ''928 , ''929 ];930931 return usage932 .concat(cmds)933 .concat(desc)934 .concat(options)914 ].join('\n');935 .join('\n');936};937938/**939 * Output help information for this command
81 unmodified lines