Function getChoiceOption

  • Transform TypeBox TLiteral or TUnion of TLiteral schema and options appended in schema to yargs options.

    Type Parameters

    Parameters

    • schema: S

      TypeBox TLiteral or TUnion of TLiteral schema to transform

    • overwrites: O = ...

      overwrites for yargs options result

    Returns {
        alias: undefined | string | readonly string[];
        coerce: undefined | ((arg: any) => any);
        config: undefined | boolean;
        configParser: undefined | ((configPath: string) => object);
        conflicts:
            | undefined
            | string
            | readonly string[]
            | {
                [key: string]: string | readonly string[];
            };
        count: undefined | boolean;
        default: undefined | Static<S>;
        defaultDescription: undefined | string;
        demandOption: string | boolean;
        deprecated: undefined | string | boolean;
        describe: undefined | string;
        global: undefined | boolean;
        group: undefined | string;
        hidden: undefined | boolean;
        implies:
            | undefined
            | string
            | readonly string[]
            | {
                [key: string]: string | readonly string[];
            };
        nargs: undefined | number;
        normalize: undefined | boolean;
        requiresArg: undefined | boolean;
        skipValidation: undefined | boolean;
        type: "string";
    } & {
        choices: Static<S>[];
    } & O

    applicable yargs options in schema and overwrites