Rush StackShopBlogEvents
Skip to main content

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

ICommandLineChoiceDefinition interface

For use with CommandLineParameterProvider.defineChoiceParameter() and CommandLineParameterProvider.defineChoiceParameter(), this interface defines a command line parameter which is constrained to a list of possible options.

Signature:

export interface ICommandLineChoiceDefinition<TChoice extends string = string> extends IBaseCommandLineDefinition 

Extends: IBaseCommandLineDefinition

Properties

Property

Modifiers

Type

Description

alternatives

ReadonlyArray<TChoice> | ReadonlySet<TChoice>

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

completions?

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

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

defaultValue?

TChoice

(Optional) The default value which will be used if the parameter is omitted from the command line.