Skip to content
Myr

Moved -h, --help option definition

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

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 2fd3d5a · Browse files · 1 file+11 added−8 removed
This commit

State

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

Diff stats

1 file+11 added−8 removed

  • other:+11 added−8 removed

1 file+11 added−8 removed

modified:lib/commander.js+11 added-8 removed
303 unmodified lines
304305 // guess name306 if (!this.name) this.name = basename(argv[1]);307308 // default options309 this.option('-h, --help', 'output usage information');310 this.on('help', function(){311 process.stdout.write(this.helpInformation());312 process.exit(0);313 });314308 // process argv309 this.args = this.parseOptions(this.normalize(argv));310 return this.parseArgs(this.args);311};
566 unmodified lines
878879function pad(str, width) {880 var len = Math.max(0, width - str.length);881 return str + Array(len + 1).join(' ');889}882}883884/**885 * Default -h, --help option.886 */887888exports.option('-h, --help', 'output usage information');889exports.on('help', function(){890 process.stdout.write(this.helpInformation());891 process.exit(0);892});