From 1b492d97273b286ecc50237269016b50d572ad6c Mon Sep 17 00:00:00 2001 From: Caleb Everett Date: Sun, 8 May 2022 19:16:05 -0700 Subject: [PATCH] Add string[] to options defaultValue type (#1721) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add string[] to Command.option() defaultValue type. Co-authored-by: Caleb ツ Everett --- typings/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/typings/index.d.ts b/typings/index.d.ts index 34a51202f..98f460742 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -523,10 +523,10 @@ export class Command { * * @returns `this` command for chaining */ - option(flags: string, description?: string, defaultValue?: string | boolean): this; + option(flags: string, description?: string, defaultValue?: string | boolean | string[]): this; option(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this; /** @deprecated since v7, instead use choices or a custom function */ - option(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean): this; + option(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this; /** * Define a required option, which must have a value after parsing. This usually means @@ -534,10 +534,10 @@ export class Command { * * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. */ - requiredOption(flags: string, description?: string, defaultValue?: string | boolean): this; + requiredOption(flags: string, description?: string, defaultValue?: string | boolean | string[]): this; requiredOption(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this; /** @deprecated since v7, instead use choices or a custom function */ - requiredOption(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean): this; + requiredOption(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this; /** * Factory routine to create a new unattached option.