diff --git a/lib/command.js b/lib/command.js index 907962f56..8870d29de 100644 --- a/lib/command.js +++ b/lib/command.js @@ -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 + ]); } /** @@ -1807,7 +1807,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 diff --git a/typings/index.d.ts b/typings/index.d.ts index 73c606a5d..695c3bd25 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -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.