diff --git a/typings/index.d.ts b/typings/index.d.ts index 73c606a5d..5f34c4c0f 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -293,7 +293,8 @@ 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; + version(): string; /** * Define a command, implemented using an action handler. diff --git a/typings/index.test-d.ts b/typings/index.test-d.ts index 734036fad..b5019cf0c 100644 --- a/typings/index.test-d.ts +++ b/typings/index.test-d.ts @@ -36,6 +36,7 @@ expectType(program.parent); expectType(program.version('1.2.3')); expectType(program.version('1.2.3', '-r,--revision')); expectType(program.version('1.2.3', '-r,--revision', 'show revision information')); +expectType(program.version()); // command (and CommandOptions) expectType(program.command('action'));