@wcauchois/program-builder > ProgramBuilder > flag

ProgramBuilder.flag() method

Add a boolean-valued flag to the program (sometimes known as a "switch").

Signature:
flag<K extends string>(name: string, options: IBooleanFlagOptions<K>): ExtendProgramBuilderWithRequired<T, K, boolean>;

Parameters

ParameterTypeDescription
name
string
The name for the flag, including leading dashes. Multiple alternative names may be specified by separating them within the string by commas. For example, "-i,--input".
optionsIBooleanFlagOptions<K>See IBooleanFlagOptions.
Returns:

ExtendProgramBuilderWithRequired<T, K, boolean>