Interface StringDeclarationOption

interface StringDeclarationOption {
    help: string;
    name: string;
    configFileOnly?: boolean;
    defaultValue?: string;
    hint?: ParameterHint;
    type?: String | Path;
    validate?: ((value) => void);
}

Hierarchy (view full)

Properties

help: string

The help text to be displayed to the user when --help is passed.

name: string

The option name.

configFileOnly?: boolean

If set, this option will be omitted from --help, and attempting to specify it on the command line will produce an error.

defaultValue?: string

If not specified defaults to the empty string for both String and Path.

An optional hint for the type of input expected, will be displayed in the help output.

type?: String | Path

Specifies the resolution strategy. If Path is provided, values will be resolved according to their location in a file. If String or no value is provided, values will not be resolved.

validate?: ((value) => void)

An optional validation function that validates a potential value of this option. The function must throw an Error if the validation fails and should do nothing otherwise.

Type declaration

    • (value): void
    • Parameters

      • value: string

      Returns void