Home > @rushstack/ts-command-line > CommandLineParameterProvider > defineChoiceListParameter
CommandLineParameterProvider.defineChoiceListParameter() method
Defines a command-line parameter whose value must be a string from a fixed set of allowable choices (similar to an enum). The parameter can be specified multiple times to build a list.
Signature:
defineChoiceListParameter(definition: ICommandLineChoiceListDefinition): CommandLineChoiceListParameter;
Parameters
Parameter | Type | Description |
---|---|---|
definition | ICommandLineChoiceListDefinition |
Returns:
CommandLineChoiceListParameter
Remarks
Example of a choice list parameter:
example-tool --allow-color red --allow-color green