Represents a child command processor

interface ICliCommandChildProcessor {
    allowUnlistedCommands?: boolean;
    author?: ICliCommandAuthor;
    command: string;
    description?: string;
    hooks?: ICliProcessorHook[];
    metadata?: CliProcessorMetadata;
    parameters?: ICliCommandParameterDescriptor[];
    parent?: ICliCommandProcessor;
    processors?: ICliCommandChildProcessor[];
    stateConfiguration?: CliStateConfiguration;
    validateBeforeExecution?: (
        command: CliProcessCommand,
        context: ICliExecutionContext,
    ) => { message?: string; valid: boolean };
    valueRequired?: boolean;
    version?: string;
    initialize(context: ICliExecutionContext): Promise<void>;
    processCommand(
        command: CliProcessCommand,
        context: ICliExecutionContext,
    ): Promise<void>;
    writeDescription(context: ICliExecutionContext): void;
}

Hierarchy (View Summary)

Properties

allowUnlistedCommands?: boolean

If true, the processor can handle unlisted commands

false

If true, the processor can handle unlisted commands. If false, the processor will only handle commands that are explicitly listed in the processors property

The author of the command

command: string

The command that this processor handles

description?: string

A description of the command

Hooks that are executed before and after the command is processed

The metadata for the command processor

Parameters that the command accepts

The parent processor, it is populated by the processor manager

Processors that are nested under this processor

stateConfiguration?: CliStateConfiguration

Represents the state configuration for the command processor

The state configuration is used to store and retrieve state information for the command processor

validateBeforeExecution?: (
    command: CliProcessCommand,
    context: ICliExecutionContext,
) => { message?: string; valid: boolean }

A function that validates the command before execution

Type declaration

    • (
          command: CliProcessCommand,
          context: ICliExecutionContext,
      ): { message?: string; valid: boolean }
    • Parameters

      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

valueRequired?: boolean

If true, the value is required

version?: string

The version of the command processor

'1.0.0'

Methods