Skip to content

Commit

Permalink
Merge pull request #1018 from nazieb/develop
Browse files Browse the repository at this point in the history
fix showing help for sub commands with custom executableFile
  • Loading branch information
shadowspawn authored Aug 16, 2019
2 parents 8b8d6e6 + bd8be00 commit 3e89cc9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,14 @@ Command.prototype.parse = function(argv) {

var result = this.parseArgs(this.args, parsed.unknown);

if (args[0] === 'help' && args.length === 1) this.help();

// <cmd> --help
if (args[0] === 'help') {
args[0] = args[1];
args[1] = this._helpLongFlag;
}

// executable sub-commands
// (Debugging note for future: args[0] is not right if an action has been called)
var name = result.args[0];
Expand Down Expand Up @@ -511,13 +519,6 @@ Command.prototype.executeSubCommand = function(argv, args, unknown, executableFi
args = args.concat(unknown);

if (!args.length) this.help();
if (args[0] === 'help' && args.length === 1) this.help();

// <cmd> --help
if (args[0] === 'help') {
args[0] = args[1];
args[1] = this._helpLongFlag;
}

var isExplicitJS = false; // Whether to use node to launch "executable"

Expand Down

0 comments on commit 3e89cc9

Please sign in to comment.