Skip to content

Commit

Permalink
Merge branch 'feature/createOption-in-helpOption' into feature/obscur…
Browse files Browse the repository at this point in the history
…ed-help-option-warnings
  • Loading branch information
aweebit committed Aug 13, 2023
2 parents daa3fed + 513a4b5 commit aa6e9b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/command.js
Expand Up @@ -1116,9 +1116,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
}

// Fallback to parsing the help flag to invoke the help.
if (this._helpOption.long) {
return this._dispatchSubcommand(subcommandName, [], [this._helpOption.long]);
}
return this._dispatchSubcommand(subcommandName, [], [
this._helpOption.long || this._helpOption.short
]);
}

/**
Expand Down Expand Up @@ -1824,7 +1824,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
*
* You can optionally supply the flags and description to override the defaults.
*
* @param {string} [str]
* @param {string} str
* @param {string} [flags]
* @param {string} [description]
* @return {this | string} `this` command for chaining, or version string if no arguments
Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Expand Up @@ -293,7 +293,7 @@ export class Command {
*
* You can optionally supply the flags and description to override the defaults.
*/
version(str?: string, flags?: string, description?: string): this;
version(str: string, flags?: string, description?: string): this;

/**
* Define a command, implemented using an action handler.
Expand Down

0 comments on commit aa6e9b3

Please sign in to comment.