From f3a45fb082dc1d7a5c85c7f13d20c615d9b2b613 Mon Sep 17 00:00:00 2001 From: Wee Bit Date: Sat, 12 Aug 2023 20:11:02 +0200 Subject: [PATCH] Overload version() correctly and add test for new overload- --- typings/index.d.ts | 3 ++- typings/index.test-d.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) 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'));