These handlers enable manipulation of the CLI arguments and their processing.

Implementations of this interface can be passed via the KeysInitSparql.cliArgsHandlers context entry.

interface ICliArgsHandler {
    handleArgs: (
        args: Record<string, any>,
        context: Record<string, any>,
    ) => Promise<void>;
    populateYargs: (argumentsBuilder: Argv<any>) => Argv<any>;
}

Implemented by

Properties

handleArgs: (
    args: Record<string, any>,
    context: Record<string, any>,
) => Promise<void>

Process the incoming arguments, and modify the context if needed.

Type declaration

    • (args: Record<string, any>, context: Record<string, any>): Promise<void>
    • Parameters

      • args: Record<string, any>

        The parsed yargs arguments.

      • context: Record<string, any>

        The mutable context.

      Returns Promise<void>

populateYargs: (argumentsBuilder: Argv<any>) => Argv<any>

Add to the yargs arguments builder.

Type declaration

    • (argumentsBuilder: Argv<any>): Argv<any>
    • Parameters

      • argumentsBuilder: Argv<any>

        A yargs argument builder object.

      Returns Argv<any>