Skip to content

OptionDefinition interface

Home > streplts > OptionDefinition

Structural definition specifying configurations for unordered option flags or switches.

Signature:

export interface OptionDefinition

Property

Modifiers

Type

Description

choices?

string[] | ((typed: string, previousArgs: string[], context: any, globals: any) => string[]) | null

(Optional) An static string array or a dynamic evaluation closure generating eligible autocomplete variations for the option’s value.

description?

string

(Optional) A brief description of the option’s purpose, used in help documentation to inform users about its functionality.

name

string

The unique identifier labeling the target option flag, excluding prefix dashes. For example, “verbose” for a “—verbose” flag.

short?

string

(Optional) Optional single-character alias serving as a shorthand for the option. For example, “v” for a “—verbose” flag.

type

“boolean” | “string”

Defines the expected data type for the option’s value, which can be either a boolean (for flags) or a string (for options that require a value).