Skip to content
Myr

Rename help check routine

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

authored by John Gee · committed by John Gee · parent 03e77df · Browse files · 1 file+4 added−4 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+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:index.js+4 added-4 removed
326 unmodified lines
327328 var parsed = self.parseOptions(unknown);329330 // Output help if necessary331 outputHelpIfNecessary(self, parsed.unknown);331 outputHelpIfRequested(self, parsed.unknown);332 self._checkForMissingMandatoryOptions();333334 // If there are still any unknown options, then we simply335 // die, unless someone asked for help, in which case we give it
536 unmodified lines
872 } else {873 this.emit('command:*', args, unknown);874 }875 } else {876 outputHelpIfNecessary(this, unknown);876 outputHelpIfRequested(this, unknown);877878 // If there were no args and we have unknown options,879 // then they are extraneous and we need to error.880 if (unknown.length > 0 && !this.defaultExecutable) {
652 unmodified lines
1533 return wrap(str, width, indent);1534}15351536/**1537 * Output help information if necessary1537 * Output help information if help flags specified1538 *1539 * @param {Command} command to output help for1540 * @param {Array} array of options to search for -h or --help1541 * @api private1542 */15431544function outputHelpIfNecessary(cmd, options) {1544function outputHelpIfRequested(cmd, options) {1545 options = options || [];15461547 for (var i = 0; i < options.length; i++) {1548 if (options[i] === cmd._helpLongFlag || options[i] === cmd._helpShortFlag) {
80 unmodified lines