Skip to content

Commit

Permalink
Fixed #37, --help should not display first (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Johnson authored and abetomo committed Jul 1, 2017
1 parent f2eb7e3 commit 3c2fd5c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions index.js
Expand Up @@ -933,12 +933,11 @@ Command.prototype.largestOptionLength = function() {
Command.prototype.optionHelp = function() {
var width = this.largestOptionLength();

// Prepend the help information
return [pad('-h, --help', width) + ' ' + 'output usage information']
.concat(this.options.map(function(option) {
return pad(option.flags, width) + ' ' + option.description;
}))
.join('\n');
// Append the help information
return this.options.map(function(option) {
return pad(option.flags, width) + ' ' + option.description;
}).concat([pad('-h, --help', width) + ' ' + 'output usage information'])
.join('\n');
};

/**
Expand Down

0 comments on commit 3c2fd5c

Please sign in to comment.