Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/ts-command-line > CommandLineChoiceListParameter

CommandLineChoiceListParameter class

The data type returned by CommandLineParameterProvider.defineChoiceListParameter().

Signature:

export declare class CommandLineChoiceListParameter<TChoice extends string = string> extends CommandLineParameterBase 

Extends: CommandLineParameterBase

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the CommandLineChoiceListParameter class.

Properties

Property

Modifiers

Type

Description

alternatives

readonly

ReadonlySet<TChoice>

A list of strings (which contain no spaces), of possible options which can be selected

completions

readonly

(() => Promise<ReadonlyArray<TChoice> | ReadonlySet<TChoice>>) | undefined

An optional callback that provides a list of custom choices for tab completion.

kind

readonly

CommandLineParameterKind.ChoiceList

Indicates the type of parameter.

values

readonly

ReadonlyArray<TChoice>

Returns the string arguments for a choice list parameter that was parsed from the command line.

Methods

Method

Modifiers

Description

appendToArgList(argList)

Append the parsed values to the provided string array.