Skip to content

Commit 1b492d9

Browse files
authoredMay 9, 2022
Add string[] to options defaultValue type (#1721)
Add string[] to Command.option() defaultValue type. Co-authored-by: Caleb ツ Everett <calebev@amazon.com>
1 parent 06cf751 commit 1b492d9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎typings/index.d.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -523,21 +523,21 @@ export class Command {
523523
*
524524
* @returns `this` command for chaining
525525
*/
526-
option(flags: string, description?: string, defaultValue?: string | boolean): this;
526+
option(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
527527
option<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;
528528
/** @deprecated since v7, instead use choices or a custom function */
529-
option(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean): this;
529+
option(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
530530

531531
/**
532532
* Define a required option, which must have a value after parsing. This usually means
533533
* the option must be specified on the command line. (Otherwise the same as .option().)
534534
*
535535
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
536536
*/
537-
requiredOption(flags: string, description?: string, defaultValue?: string | boolean): this;
537+
requiredOption(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
538538
requiredOption<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;
539539
/** @deprecated since v7, instead use choices or a custom function */
540-
requiredOption(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean): this;
540+
requiredOption(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
541541

542542
/**
543543
* Factory routine to create a new unattached option.

0 commit comments

Comments
 (0)
Please sign in to comment.