Skip to content

Commit 513a4b5

Browse files
committed
Merge branch 'feature/fixes' into feature/createOption-in-helpOption
2 parents 7335a9c + 8dd417f commit 513a4b5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/command.js

+4-4
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
/**
@@ -1807,7 +1807,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
18071807
*
18081808
* You can optionally supply the flags and description to override the defaults.
18091809
*
1810-
* @param {string} [str]
1810+
* @param {string} str
18111811
* @param {string} [flags]
18121812
* @param {string} [description]
18131813
* @return {this | string} `this` command for chaining, or version string if no arguments

typings/index.d.ts

+1-1
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)