Skip to content

Commit

Permalink
Merge branch 'feature/createOption-in-helpOption' into feature/help-o…
Browse files Browse the repository at this point in the history
…ption-refactor
  • Loading branch information
aweebit committed Aug 13, 2023
2 parents f8e5faf + 513a4b5 commit e01bb9a
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
Original file line number Diff line number Diff line change
Expand Up @@ -1099,9 +1099,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 @@ -1842,7 +1842,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
Original file line number Diff line number Diff line change
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 e01bb9a

Please sign in to comment.