Skip to content

Commit e01bb9a

Browse files
committed
Merge branch 'feature/createOption-in-helpOption' into feature/help-option-refactor
2 parents f8e5faf + 513a4b5 commit e01bb9a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/command.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,9 +1099,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
10991099
}
11001100

11011101
// Fallback to parsing the help flag to invoke the help.
1102-
if (this._helpOption.long) {
1103-
return this._dispatchSubcommand(subcommandName, [], [this._helpOption.long]);
1104-
}
1102+
return this._dispatchSubcommand(subcommandName, [], [
1103+
this._helpOption.long || this._helpOption.short
1104+
]);
11051105
}
11061106

11071107
/**
@@ -1842,7 +1842,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
18421842
*
18431843
* You can optionally supply the flags and description to override the defaults.
18441844
*
1845-
* @param {string} [str]
1845+
* @param {string} str
18461846
* @param {string} [flags]
18471847
* @param {string} [description]
18481848
* @return {this | string} `this` command for chaining, or version string if no arguments

typings/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ export class Command {
293293
*
294294
* You can optionally supply the flags and description to override the defaults.
295295
*/
296-
version(str?: string, flags?: string, description?: string): this;
296+
version(str: string, flags?: string, description?: string): this;
297297

298298
/**
299299
* Define a command, implemented using an action handler.

0 commit comments

Comments
 (0)