Skip to content

Commit

Permalink
Add string[] to options defaultValue type (#1721)
Browse files Browse the repository at this point in the history
Add string[] to Command.option() defaultValue type.


Co-authored-by: Caleb ツ Everett <calebev@amazon.com>
  • Loading branch information
everett1992 and Caleb ツ Everett committed May 9, 2022
1 parent 06cf751 commit 1b492d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions typings/index.d.ts
Expand Up @@ -523,21 +523,21 @@ 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<T>(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
* the option must be specified on the command line. (Otherwise the same as .option().)
*
* 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<T>(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.
Expand Down

0 comments on commit 1b492d9

Please sign in to comment.