Skip to content

Commit

Permalink
Rename help check routine
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowspawn committed Jan 1, 2020
1 parent 03e77df commit d47fb0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ Command.prototype.action = function(fn) {
var parsed = self.parseOptions(unknown);

// Output help if necessary
outputHelpIfNecessary(self, parsed.unknown);
outputHelpIfRequested(self, parsed.unknown);
self._checkForMissingMandatoryOptions();

// If there are still any unknown options, then we simply
Expand Down Expand Up @@ -873,7 +873,7 @@ Command.prototype.parseArgs = function(args, unknown) {
this.emit('command:*', args, unknown);
}
} else {
outputHelpIfNecessary(this, unknown);
outputHelpIfRequested(this, unknown);

// If there were no args and we have unknown options,
// then they are extraneous and we need to error.
Expand Down Expand Up @@ -1534,14 +1534,14 @@ function optionalWrap(str, width, indent) {
}

/**
* Output help information if necessary
* Output help information if help flags specified
*
* @param {Command} command to output help for
* @param {Array} array of options to search for -h or --help
* @api private
*/

function outputHelpIfNecessary(cmd, options) {
function outputHelpIfRequested(cmd, options) {
options = options || [];

for (var i = 0; i < options.length; i++) {
Expand Down

0 comments on commit d47fb0c

Please sign in to comment.