Type alias WithValue<T>

WithValue<T>: {
    clusterLetters?: string;
    default?: Readonly<T> | DefaultCallback<T>;
    required?: true;
    requiredIf?: Requires;
    requires?: Requires;
}

Defines attributes common to options with values.

Type Parameters

  • T

    The option value data type

Type declaration

  • Optional Readonly clusterLetters?: string

    The letters used for clustering in short-option style (e.g., 'fF').

  • Optional Readonly default?: Readonly<T> | DefaultCallback<T>

    The option default value or a callback that returns the default value.

    The default value is set at the end of the parsing loop if the option was specified neither on the command-line nor as an environment variable. You may use a callback to inspect parsed values and determine the default value based on those values.

  • Optional Readonly required?: true

    True if the option is always required.

  • Optional Readonly requiredIf?: Requires

    The conditional requirements.

  • Optional Readonly requires?: Requires

    The option requirements.