Represents a command parameter

interface ICliCommandParameterDescriptor {
    aliases?: string[];
    defaultValue?: any;
    description: string;
    name: string;
    required: boolean;
    type: string;
    validator?: (value: any) => { message?: string; valid: boolean };
}

Properties

aliases?: string[]

Aliases for the parameter

defaultValue?: any

The default value of the parameter

description: string

A description of the parameter

name: string

The name of the parameter

required: boolean

If true, the parameter is required

type: string

The type of the parameter

validator?: (value: any) => { message?: string; valid: boolean }

A validator function that validates the value of the parameter

Type declaration

    • (value: any): { message?: string; valid: boolean }
    • Parameters

      • value: any

        The value to validate

      Returns { message?: string; valid: boolean }

      An object with a valid property that indicates if the value is valid and an optional message property that contains a message to display if the value is not valid

      • Optionalmessage?: string

        An optional message to display if the value is not valid

      • valid: boolean

        Indicates if the value is valid