CLIArgumentType | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Interface CLIArgumentType<ValueType>

    interface CLIArgumentType<ValueType> {
        description?: string;
        autoComplete(
            startsWith: string,
            options: { argName: string; command?: string; cwd: string },
        ): string[] | Promise<string[]>;
        parseValue(
            arg: string,
            options: { argName: string; command?: string },
        ): ValueType;
    }

    Type Parameters

    • ValueType
    Index

    Properties

    description?: string

    Methods

    • Return possible autocomplete sugegestions. Incomplete suggestions (user should add more text) should end with a '*'. Returned values that do not match the supplied 'startsWith' are ignored cwd is the current working directory, is filled in from WH 5.9+.

      Parameters

      • startsWith: string
      • options: { argName: string; command?: string; cwd: string }

      Returns string[] | Promise<string[]>

    • Parses a user-provided value. Throws CLISyntaxError. Required to allow typeinference to work.

      Parameters

      • arg: string
      • options: { argName: string; command?: string }

      Returns ValueType