Skip to content
Myr

Add string[] to options defaultValue type (#1721)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Add string[] to Command.option() defaultValue type.

authored by Caleb Everett · committed by GitHub · parent 06cf751 · Browse files · 1 file+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: Caleb ツ Everett <calebev@amazon.com>

Diff stats

1 file+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:typings/index.d.ts+4 added-4 removed
521 unmodified lines
522 * ```523 *524 * @returns `this` command for chaining525 */526 option(flags: string, description?: string, defaultValue?: string | boolean): this;526 option(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;527 option<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;528 /** @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;530531 /**532 * Define a required option, which must have a value after parsing. This usually means533 * the option must be specified on the command line. (Otherwise the same as .option().)534 *535 * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.536 */537 requiredOption(flags: string, description?: string, defaultValue?: string | boolean): this;537 requiredOption(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;538 requiredOption<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;539 /** @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;541542 /**543 * Factory routine to create a new unattached option.544 *
311 unmodified lines