Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/ts-command-line > CommandLineParameterProvider > defineChoiceParameter

CommandLineParameterProvider.defineChoiceParameter() method

Defines a command-line parameter whose value must be a string from a fixed set of allowable choices (similar to an enum).

Signature:

defineChoiceParameter(definition: ICommandLineChoiceDefinition): CommandLineChoiceParameter;

Parameters

ParameterTypeDescription
definitionICommandLineChoiceDefinition

Returns:

CommandLineChoiceParameter

Remarks

Example of a choice parameter:

example-tool --log-level warn