Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix showing help for sub commands with custom executableFile #1018

Merged
merged 1 commit into from Aug 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 8 additions & 7 deletions index.js
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