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

    Function runCli

    • Run a command line application

      Type Parameters

      • const E extends object
      • const S extends object
      • const SS extends object

      Parameters

      • data: InferRootOptionsArguments<E> & InferSubCommandOptionsArguments<S> & InferSubSubCommandOptionsArguments<
            SS,
        > & NoInfer<
            (
                ParseData & (E & Simplify<{ [K in keyof S]: K extends keyof SS ? Simplify<{ [K in keyof S[K]]: K extends keyof SS[K] ? Simplify<{ [K in keyof S[K][K]]: K extends keyof SS[K][K] ? Simplify<...> : S[K][K][K]; } & { [K in keyof SS[K][K] as K extends keyof S[K][K] ? never : K]: SS[K][K][K]; }> : S[K][K]; } & { [K in key...
            ) & (
                (
                    E & Simplify<
                        {
                            [K in string
                            | number
                            | symbol]: K extends keyof SS ? Simplify<(...) & (...)> : S[K]
                        } & {
                            [K in string
                            | number
                            | symbol as K extends keyof S ? never : K]: SS[K]
                        },
                    >
                ) extends { subCommands: {} }
                    ? { subCommands: SanitizeSubCommandOptArgs<O["subCommands"]> }
                    : {}
            ) & MainDeclarations<
                E & Simplify<
                    {
                        [K in string
                        | number
                        | symbol]: K extends keyof SS ? Simplify<(...) & (...)> : S[K]
                    } & {
                        [K in string
                        | number
                        | symbol as K extends keyof S ? never : K]: SS[K]
                    },
                >,
                null,
                [
                    E & Simplify<
                        {
                            [K in string
                            | number
                            | symbol]: K extends keyof (...) ? Simplify<(...)> : (...)[(...)]
                        } & {
                            [K in string
                            | number
                            | symbol as K extends keyof (...) ? never : K]: SS[K]
                        },
                    >,
                ],
            >,
        >

        Command configuration

      • options: { argv?: string[] } = {}

        Options for the run

        • argv: Override arguments. (defaults to process.argv.slice(2))

      Returns {
          globalOpts: NarrowTruthy<
              Simplify<
                  Simplify<
                      {
                          -readonly [Key in string as OptionValueAlwaysPresent<
                              ((...)[(...)] & {})[Key],
                          > extends true
                              ? GetOptionListStoreName<Key>
                              : never]-?: GetParsedType<
                              (((...) & (...))["options"] & {})[Key],
                              string,
                              IsMultiple<((...)[(...)] & {})[Key]>,
                          >
                      } & {
                          -readonly [Key in string as OptionValueAlwaysPresent<
                              ((...)[(...)] & {})[Key],
                          > extends true
                              ? never
                              : GetOptionListStoreName<Key>]?: GetParsedType<
                              ((...)[(...)] & {})[Key],
                              string,
                              IsMultiple<((...) & (...))[Key]>,
                          >
                      } & {
                          -readonly [Key in string as GetOptionListStoreName<Key>]: boolean
                      } & object,
                  >,
              >,
          >;
          onDone?: () => void;
          specifiedGlobalOpts: (
              keyof Simplify<
                  Simplify<
                      {
                          -readonly [Key in string as OptionValueAlwaysPresent<
                              ((...) & (...))[Key],
                          > extends true
                              ? GetOptionListStoreName<Key>
                              : never]-?: GetParsedType<
                              ((...)[(...)] & {})[Key],
                              string,
                              IsMultiple<((...) & (...))[Key]>,
                          >
                      } & {
                          -readonly [Key in string as OptionValueAlwaysPresent<
                              ((...) & (...))[Key],
                          > extends true
                              ? never
                              : GetOptionListStoreName<Key>]?: GetParsedType<
                              ((...) & (...))[Key],
                              string,
                              IsMultiple<(...)[(...)]>,
                          >
                      } & {
                          -readonly [Key in string as GetOptionListStoreName<Key>]: boolean
                      } & object,
                  >,
              >
          )[];
      }