Function run
- run<const E extends object, const S extends object>(
data: InferRootOptionsArguments<E> & InferSubCommandOptionsArguments<S> & NoInfer<
(
ParseData & (E & S extends { options: {}; } ? { options: SanitizeOptions<({ options: {}; } & E & S)["options"]>; } : {})
) & (
(E & S) extends { subCommands: {} }
? {
subCommands: SanitizeSubCommandOptArgs<
({ subCommands: {} } & E & S)["subCommands"],
>;
}
: {}
) & MainDeclarations<E & S, null, null>,
>,
options?: { argv?: string[] },
): {
globalOpts: NarrowTruthy<
Simplify<
Simplify<
{
-readonly [Key in string as "default" extends keyof (
(...)[(...)] & {}
)[Key]
? GetOptionListStoreName<Key>
: never]-?: GetParsedType<
(((...) & (...))["options"] & {})[Key],
string,
IsMultiple<((...)[(...)] & {})[Key]>,
>
} & {
-readonly [Key in string as "default" extends keyof (
(...)[(...)] & {}
)[Key]
? 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 "default" extends keyof ((...) & (...))[Key]
? GetOptionListStoreName<Key>
: never]-?: GetParsedType<
((...)[(...)] & {})[Key],
string,
IsMultiple<((...) & (...))[Key]>,
>
} & {
-readonly [Key in string as "default" extends keyof ((...) & (...))[Key]
? never
: GetOptionListStoreName<Key>]?: GetParsedType<
((...) & (...))[Key],
string,
IsMultiple<(...)[(...)]>,
>
} & {
-readonly [Key in string as GetOptionListStoreName<Key>]: boolean
} & object,
>,
>
)[];
}Type Parameters
- const E extends object
- const S extends object
Parameters
- data: InferRootOptionsArguments<E> & InferSubCommandOptionsArguments<S> & NoInfer<
(
ParseData & (E & S extends { options: {}; } ? { options: SanitizeOptions<({ options: {}; } & E & S)["options"]>; } : {})
) & (
(E & S) extends { subCommands: {} }
? {
subCommands: SanitizeSubCommandOptArgs<
({ subCommands: {} } & E & S)["subCommands"],
>;
}
: {}
) & MainDeclarations<E & S, null, null>,
>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 "default" extends keyof (
(...)[(...)] & {}
)[Key]
? GetOptionListStoreName<Key>
: never]-?: GetParsedType<
(((...) & (...))["options"] & {})[Key],
string,
IsMultiple<((...)[(...)] & {})[Key]>,
>
} & {
-readonly [Key in string as "default" extends keyof (
(...)[(...)] & {}
)[Key]
? 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 "default" extends keyof ((...) & (...))[Key]
? GetOptionListStoreName<Key>
: never]-?: GetParsedType<
((...)[(...)] & {})[Key],
string,
IsMultiple<((...) & (...))[Key]>,
>
} & {
-readonly [Key in string as "default" extends keyof ((...) & (...))[Key]
? never
: GetOptionListStoreName<Key>]?: GetParsedType<
((...) & (...))[Key],
string,
IsMultiple<(...)[(...)]>,
>
} & {
-readonly [Key in string as GetOptionListStoreName<Key>]: boolean
} & object,
>,
>
)[];
}
Run a command line application