Interface FlagOptionsLike<T>

Type Parameters

  • T

Hierarchy

  • FlagOptionsLike

Properties

default?: T

Default value when no flag is specified

isValid?: ((v: T) => boolean)

Type declaration

    • (v: T): boolean
    • Optional parameter validation function

      Remarks

      If values is set at the same time, isValid will be called for verification when the values do not match, and if the values match, the value will be considered valid and will not call isValid

      Parameters

      • v: T

      Returns boolean

name: string

flag long name

Remarks

The name must match the regular expression /^[a-zA-Z][a-zA-Z0-9-_.]*$/u, as you can see some special symbols are not allowed this is intentional, Because I think using strange special symbols as flags names will give users a very bad experience

short?: string

Optional flag short name

Remarks

The short name must match the regular expression /^[a-zA-Z0-9]$/u, as you can see symbols are not allowed this is intentional, Because I think using symbols as flags short names will give users a very bad experience

usage?: string

Optional flag usage description

values?: T[]

An optional list of valid values for the flag

Remarks

If isValid is set at the same time, isValid will be called for verification when the values do not match, and if the values match, the value will be considered valid and will not call isValid

Generated using TypeDoc