Class FlagOption<T>

Non-positional, flag-based CLI option.

Type Parameters

  • T

Hierarchy

Constructors

  • Type Parameters

    • T

    Parameters

    • Optional longFlag: string

      The long-form flag for this option.

      Example

      --path, --create
      
    • Optional shortFlag: string

      The short-form flag for this option.

      Example

      -p, -c
      
    • Optional message: string

      Usage message describing this flag.

    • Optional argumentDescription: string

      Description of the argument required by this flag. If this is set, the flag will expect a positional argument to follow as a param.

    Returns FlagOption<T>

Properties

argumentDescription?: string

Description of the argument required by this flag. If this is set, the flag will expect a positional argument to follow as a param.

blacklistItems: T[] = []

Blacklisted values.

equalityValue?: T

The value to be used to check equality.

greaterThanBit: boolean = false

If true, the greater than will be greater than or equal to.

greaterThanValue?: T

Value to be compared in greater than.

isOptional: boolean = false

Is this option optional?

lessThanBit: boolean = false

If true, the less than will be less than or equal to.

lessThanValue?: T

Value to be compared in less than.

longFlag?: string

The long-form flag for this option.

Example

--path, --create
message?: string

Usage message describing this flag.

shortFlag?: string

The short-form flag for this option.

Example

-p, -c
useBlacklist: boolean = false

Do we use the blacklist?

useEquality: boolean = false

Do we use the equality operator?

useGreaterThan: boolean = false

Do we use the greater-than comparison?

useLessThan: boolean = false

Do we use the less-than comparison?

useWhitelist: boolean = false

Do we use the whitelist?

whitelistItems: T[] = []

Whitelisted values.

Methods