import { type ParseFlagsContext } from "../../flags/1.0.0-rc.8/mod.js"; import type { MapTypes, MapValue, MergeOptions, TypedArguments, TypedCommandArguments, TypedEnv, TypedOption, TypedType } from "./_argument_types.js"; import type { Merge, OneOf, ValueOf } from "./_type_utils.js"; import { type HelpOptions } from "./help/_help_generator.js"; import type { ActionHandler, Argument, ArgumentValue, CommandResult, CompleteHandler, CompleteOptions, Completion, DefaultValue, Description, EnvVar, EnvVarOptions, EnvVarValueHandler, ErrorHandler, Example, GlobalEnvVarOptions, GlobalOptionOptions, HelpHandler, Option, OptionOptions, OptionValueHandler, TypeDef, TypeOptions, TypeOrTypeHandler, VersionHandler } from "./types.js"; /** * Chainable command factory class. * * ```ts * import { Command } from "./mod.ts"; * * export const cli = new Command() * .name("todo") * .description("Example command description") * .globalOption("--verbose", "Enable verbose output.") * .globalEnv("VERBOSE=", "Enable verbose output.") * .command("add ", "Add todo.") * .action(({ verbose }, todo: string) => { * if (verbose) { * console.log("Add todo '%s'.", todo); * } * }) * .command("delete ", "Delete todo.") * .action(({ verbose }, id: string) => { * if (verbose) { * console.log("Delete todo with id '%s'.", id); * } * }); * * if (import.meta.main) { * await cli.parse(); * } * ``` */ export declare class Command | void = void, TParentCommandTypes extends Record | void = TParentCommandGlobals extends number ? any : void, TCommandOptions extends Record | void = TParentCommandGlobals extends number ? any : void, TCommandArguments extends Array = TParentCommandGlobals extends number ? any : [], TCommandGlobals extends Record | void = TParentCommandGlobals extends number ? any : void, TCommandTypes extends Record | void = TParentCommandGlobals extends number ? any : { number: number; integer: number; string: string; boolean: boolean; file: string; }, TCommandGlobalTypes extends Record | void = TParentCommandGlobals extends number ? any : void, TParentCommand extends Command | undefined = TParentCommandGlobals extends number ? any : undefined> { private types; private rawArgs; private literalArgs; private _name; private _parent?; private _globalParent?; private ver?; private desc; private _usage?; private actionHandler?; private globalActionHandler?; private options; private commands; private examples; private envVars; private aliases; private completions; private cmd; private argsDefinition?; private throwOnError; private _allowEmpty; private _stopEarly; private defaultCommand?; private _useRawArgs; private args; private isHidden; private isGlobal; private hasDefaults; private _versionOptions?; private _helpOptions?; private _versionOption?; private _helpOption?; private _help?; private _shouldExit?; private _meta; private _groupName; private _noGlobals; private errorHandler?; /** Disable version option. */ versionOption(enable: false): this; /** * Set global version option. * * @param flags The flags of the version option. * @param desc The description of the version option. * @param opts Version option options. */ versionOption(flags: string, desc?: string, opts?: OptionOptions, TCommandArguments, TCommandGlobals, TParentCommandGlobals, TCommandTypes, TCommandGlobalTypes, TParentCommandTypes, TParentCommand> & { global: true; }): this; /** * Set version option. * * @param flags The flags of the version option. * @param desc The description of the version option. * @param opts Version option options. */ versionOption(flags: string, desc?: string, opts?: OptionOptions): this; /** * Set version option. * * @param flags The flags of the version option. * @param desc The description of the version option. * @param opts The action of the version option. */ versionOption(flags: string, desc?: string, opts?: ActionHandler): this; /** Disable help option. */ helpOption(enable: false): this; /** * Set global help option. * * @param flags The flags of the help option. * @param desc The description of the help option. * @param opts Help option options. */ helpOption(flags: string, desc?: string, opts?: OptionOptions, TCommandArguments, TCommandGlobals, TParentCommandGlobals, TCommandTypes, TCommandGlobalTypes, TParentCommandTypes, TParentCommand> & { global: true; }): this; /** * Set help option. * * @param flags The flags of the help option. * @param desc The description of the help option. * @param opts Help option options. */ helpOption(flags: string, desc?: string, opts?: OptionOptions): this; /** * Set help option. * * @param flags The flags of the help option. * @param desc The description of the help option. * @param opts The action of the help option. */ helpOption(flags: string, desc?: string, opts?: ActionHandler): this; /** * Add new sub-command. * * @param name Command definition. E.g: `my-command ` * @param cmd The new child command to register. * @param override Override existing child command. */ command) | void | undefined, TGlobalTypes | void | undefined, Record | void, Array, Record | void, Record | void, Record | void, Command | void, Array, Record | void, Record | void, Record | void, undefined>>, TGlobalOptions extends (TParentCommand extends Command ? TParentCommandGlobals : Merge), TGlobalTypes extends (TParentCommand extends Command ? TParentCommandTypes : Merge)>(name: string, cmd: TCommand, override?: boolean): ReturnType extends Command | void, Record | void, infer Options, infer Arguments, infer GlobalOptions, infer Types, infer GlobalTypes, undefined> ? Command> : never; /** * Add new sub-command. * * @param name Command definition. E.g: `my-command ` * @param cmd The new child command to register. * @param override Override existing child command. */ command | void, Array, Record | void, Record | void, Record | void, OneOf | undefined>, TGlobalOptions extends (TParentCommand extends Command ? TParentCommandGlobals : Merge), TGlobalTypes extends (TParentCommand extends Command ? TParentCommandTypes : Merge)>(name: string, cmd: TCommand, override?: boolean): TCommand extends Command | void, Record | void, infer Options, infer Arguments, infer GlobalOptions, infer Types, infer GlobalTypes, OneOf | undefined> ? Command> : never; /** * Add new sub-command. * * @param nameAndArguments Command definition. E.g: `my-command ` * @param desc The description of the new child command. * @param override Override existing child command. */ command ? TParentCommandTypes : Merge>>(nameAndArguments: TNameAndArguments, desc?: string, override?: boolean): TParentCommandGlobals extends number ? Command : Command ? TParentCommandGlobals : Merge, TParentCommand extends Command ? TParentCommandTypes : Merge, void, TArguments, void, void, void, OneOf>; /** * Add new command alias. * * @param alias Tha name of the alias. */ alias(alias: string): this; /** Reset internal command reference to main command. */ reset(): OneOf; /** * Set internal command pointer to child command with given name. * @param name The name of the command to select. */ select | void = any, TArguments extends Array = any, TGlobalOptions extends Record | void = any>(name: string): Command; /***************************************************************************** **** SUB HANDLER ************************************************************ *****************************************************************************/ /** Set command name. Used in auto generated help and shell completions */ name(name: string): this; /** * Set command version. * * @param version Semantic version string string or method that returns the version string. */ version(version: string | VersionHandler, Partial, TCommandGlobals, TParentCommandGlobals, TCommandTypes, TCommandGlobalTypes, TParentCommandTypes, TParentCommand>): this; /** * Add meta data. Will be displayed in the auto generated help and in the * output of the long version. * * @param name The name/label of the metadata. * @param value The value of the metadata. */ meta(name: string, value: string): this; /** Returns an object of metadata. */ getMeta(): Record; /** Get metadata value by name. */ getMeta(name: string): string; /** * Set command help. * * @param help Help string, method, or config for generator that returns the help string. */ help(help: string | HelpHandler, Partial, TCommandGlobals, TParentCommandGlobals> | HelpOptions): this; /** * Set the long command description. * * @param description The command description. */ description(description: Description): this; /** * Set the command usage. Defaults to arguments. * * @param usage The command usage. */ usage(usage: string): this; /** Hide command from help, completions, etc. */ hidden(): this; /** Make command globally available. */ global(): this; /** * Set command arguments. * * Syntax: ` [optionalArg: number] [...restArgs:string]` */ arguments>>, TArgs extends string = string>(args: TArgs): Command; /** * Set command callback method. * * @param fn Command action handler. */ action(fn: ActionHandler): this; /** * Set command callback method. * * @param fn Command action handler. */ globalAction(fn: ActionHandler, Array, TCommandGlobals, TParentCommandGlobals, TCommandTypes, TCommandGlobalTypes, TParentCommandTypes, TParentCommand>): this; /** * Don't throw an error if the command was called without arguments. * * @param allowEmpty Enable/disable allow empty. */ allowEmpty(allowEmpty?: TAllowEmpty): false extends TAllowEmpty ? this : Command, TParentCommandTypes, Partial, TCommandArguments, TCommandGlobals, TCommandTypes, TCommandGlobalTypes, TParentCommand>; /** * Enable stop early. If enabled, all arguments starting from the first non * option argument will be passed as arguments with type string to the command * action handler. * * For example: * `command --debug-level warning server --port 80` * * Will result in: * - options: `{ debugLevel: 'warning' }` * - args: `['server', '--port', '80']` * * @param stopEarly Enable/disable stop early. */ stopEarly(stopEarly?: boolean): this; /** * Disable parsing arguments. If enabled the raw arguments will be passed to * the action handler. This has no effect for parent or child commands. Only * for the command on which this method was called. * * @param useRawArgs Enable/disable raw arguments. */ useRawArgs(useRawArgs?: boolean): Command, void, void, void, TParentCommand>; /** * Set default command. The default command is executed when the program * was called without any argument and if no action handler is registered. * * @param name Name of the default command. */ default(name: string): this; globalType, TName extends string = string>(name: TName, handler: THandler, options?: Omit): Command>, TParentCommand>; /** * Register custom type. * * @param name The name of the type. * @param handler The callback method to parse the type. * @param options Type options. */ type, TName extends string = string>(name: TName, handler: THandler, options?: TypeOptions): Command>, TCommandGlobalTypes, TParentCommand>; /** * Register global complete handler. * * @param name The name of the completion. * @param complete The callback method to complete the type. * @param options Complete options. */ globalComplete(name: string, complete: CompleteHandler, options?: Omit): this; /** * Register global complete handler. * * @param name The name of the completion. * @param complete The callback method to complete the type. * @param options Complete options. */ complete(name: string, complete: CompleteHandler, Partial, TCommandGlobals, TParentCommandGlobals, TCommandTypes, TCommandGlobalTypes, TParentCommandTypes, any>, options: CompleteOptions & { global: boolean; }): this; /** * Register complete handler. * * @param name The name of the completion. * @param complete The callback method to complete the type. * @param options Complete options. */ complete(name: string, complete: CompleteHandler, options?: CompleteOptions): this; /** * Throw validation errors instead of calling `exit()` to handle * validation errors manually. * * A validation error is thrown when the command is wrongly used by the user. * For example: If the user passes some invalid options or arguments to the * command. * * This has no effect for parent commands. Only for the command on which this * method was called and all child commands. * * **Example:** * * ```ts * import { Command, ValidationError } from "./mod.ts"; * * const cmd = new Command(); * // ... * * try { * cmd.parse(); * } catch(error) { * if (error instanceof ValidationError) { * cmd.showHelp(); * Deno.exit(1); * } * throw error; * } * ``` * * @see ValidationError */ throwErrors(): this; /** * Set custom error handler. * * @param handler Error handler callback function. */ error(handler: ErrorHandler): this; /** Get error handler callback function. */ private getErrorHandler; /** * Same as `.throwErrors()` but also prevents calling `exit()` after * printing help or version with the --help and --version option. */ noExit(): this; /** * Disable inheriting global commands, options and environment variables from * parent commands. */ noGlobals(): this; /** Check whether the command should throw errors or exit. */ protected shouldThrowErrors(): boolean; /** Check whether the command should exit after printing help or version. */ protected shouldExit(): boolean; /** * Enable grouping of options and set the name of the group. * All option which are added after calling the `.group()` method will be * grouped in the help output. If the `.group()` method can be use multiple * times to create more groups. * * @param name The name of the option group. */ group(name: string | null): this; /** * Register a global option. * * @param flags Flags string e.g: -h, --help, --manual [optionalArg:number] [...restArgs:string] * @param desc Flag description. * @param opts Flag options or custom handler for processing flag value. */ globalOption>, undefined extends TConflicts ? TRequired : false, TDefaultValue>, TMappedGlobalOptions extends MapValue, TRequired extends OptionOptions["required"] = undefined, TCollect extends OptionOptions["collect"] = undefined, TConflicts extends OptionOptions["conflicts"] = undefined, const TDefaultValue = undefined, TMappedValue = undefined>(flags: TFlags, desc: string, opts?: Omit, TCommandArguments, MergeOptions, TParentCommandGlobals, TCommandTypes, TCommandGlobalTypes, TParentCommandTypes, TParentCommand>, "value"> & { default?: DefaultValue; required?: TRequired; collect?: TCollect; value?: OptionValueHandler>, TMappedValue>; } | OptionValueHandler>, TMappedValue>): Command, TCommandTypes, TCommandGlobalTypes, TParentCommand>; /** * Add a global option. * * @param flags Flags string e.g: -h, --help, --manual [optionalArg:number] [...restArgs:string] * @param desc Flag description. * @param opts Flag options or custom handler for processing flag value. */ option>, undefined extends TConflicts ? TRequired : false, TDefaultValue>, TMappedGlobalOptions extends MapValue, TRequired extends OptionOptions["required"] = undefined, TCollect extends OptionOptions["collect"] = undefined, TConflicts extends OptionOptions["conflicts"] = undefined, const TDefaultValue = undefined, TMappedValue = undefined>(flags: TFlags, desc: string, opts: Omit, TCommandArguments, MergeOptions, TParentCommandGlobals, TCommandTypes, TCommandGlobalTypes, TParentCommandTypes, TParentCommand>, "value"> & { global: true; default?: DefaultValue; required?: TRequired; collect?: TCollect; value?: OptionValueHandler>, TMappedValue>; } | OptionValueHandler>, TMappedValue>): Command, TCommandTypes, TCommandGlobalTypes, TParentCommand>; /** * Register an option. * * @param flags Flags string e.g: -h, --help, --manual [optionalArg:number] [...restArgs:string] * @param desc Flag description. * @param opts Flag options or custom handler for processing flag value. */ option>, undefined extends TConflicts ? TRequired : false, TDefaultValue>, TMappedOptions extends MapValue, TRequired extends OptionOptions["required"] = undefined, TCollect extends OptionOptions["collect"] = undefined, TConflicts extends OptionOptions["conflicts"] = undefined, const TDefaultValue = undefined, TMappedValue = undefined>(flags: TFlags, desc: string, opts?: Omit, TCommandArguments, TCommandGlobals, TParentCommandGlobals, TCommandTypes, TCommandGlobalTypes, TParentCommandTypes, TParentCommand>, "value"> & { default?: DefaultValue; required?: TRequired; collect?: TCollect; conflicts?: TConflicts; value?: OptionValueHandler>, TMappedValue>; } | OptionValueHandler>, TMappedValue>): Command, TCommandArguments, TCommandGlobals, TCommandTypes, TCommandGlobalTypes, TParentCommand>; /** * Register command example. * * @param name Name of the example. * @param description The content of the example. */ example(name: string, description: string): this; /** * @param flags Flags string e.g: -h, --help, --manual [optionalArg:number] [...restArgs:string] * @param desc Flag description. * @param opts Flag options or custom handler for processing flag value. */ /** * Register a global environment variable. * * @param name Name of the environment variable. * @param description The description of the environment variable. * @param options Environment variable options. */ globalEnv>, TRequired>, TMappedGlobalEnvVars extends MapValue, TRequired extends EnvVarOptions["required"] = undefined, TPrefix extends EnvVarOptions["prefix"] = undefined, TMappedValue = undefined>(name: TNameAndValue, description: string, options?: Omit & { required?: TRequired; prefix?: TPrefix; value?: EnvVarValueHandler>, TMappedValue>; }): Command, TCommandTypes, TCommandGlobalTypes, TParentCommand>; /** * Register a global environment variable. * * @param name Name of the environment variable. * @param description The description of the environment variable. * @param options Environment variable options. */ env>, R>, MG extends MapValue, R extends EnvVarOptions["required"] = undefined, P extends EnvVarOptions["prefix"] = undefined, V = undefined>(name: N, description: string, options: Omit & { global: true; required?: R; prefix?: P; value?: EnvVarValueHandler>, V>; }): Command, TCommandTypes, TCommandGlobalTypes, TParentCommand>; /** * Register an environment variable. * * @param name Name of the environment variable. * @param description The description of the environment variable. * @param options Environment variable options. */ env>, TRequired>, TMappedEnvVar extends MapValue, TRequired extends EnvVarOptions["required"] = undefined, TPrefix extends EnvVarOptions["prefix"] = undefined, TMappedValue = undefined>(name: TNameAndValue, description: string, options?: Omit & { required?: TRequired; prefix?: TPrefix; value?: EnvVarValueHandler>, TMappedValue>; }): Command, TCommandArguments, TCommandGlobals, TCommandTypes, TCommandGlobalTypes, TParentCommand>; /***************************************************************************** **** MAIN HANDLER *********************************************************** *****************************************************************************/ /** * Parse command line arguments and execute matched command. * * @param args Command line args to parse. Ex: `cmd.parse( Deno.args )` */ parse(args?: string[]): Promise ? CommandResult, Array, Record, Record, Record, Record, Record, undefined> : CommandResult, MapTypes, MapTypes, MapTypes, TCommandTypes, TCommandGlobalTypes, TParentCommandTypes, TParentCommand>>; private parseCommand; private getSubCommand; private parseGlobalOptionsAndEnvVars; private parseOptionsAndEnvVars; /** Register default options like `--version` and `--help`. */ private registerDefaults; /** * Execute command. * @param options A map of options. * @param args Command arguments. */ private execute; private executeGlobalAction; /** Parse raw command line arguments. */ protected parseOptions(ctx: ParseContext, options: Option[], { stopEarly, stopOnUnknown, dotted, }?: ParseOptionsOptions): void; /** Parse argument type. */ protected parseType(type: ArgumentValue): unknown; /** * Read and validate environment variables. * @param ctx Parse context. * @param envVars env vars defined by the command. * @param validate when true, throws an error if a required env var is missing. */ protected parseEnvVars(ctx: ParseContext, envVars: Array, validate?: boolean): Promise; protected findEnvVar(names: readonly string[]): Promise<{ name: string; value: string; } | undefined>; /** * Parse command-line arguments. * @param ctx Parse context. * @param options Parsed command line options. */ protected parseArguments(ctx: ParseContext, options: Record): TCommandArguments; private handleError; /** * Handle error. If `throwErrors` is enabled the error will be thrown, * otherwise a formatted error message will be printed and `exit(1)` * will be called. This will also trigger registered error handlers. * * @param error The error to handle. */ throw(error: Error): never; /***************************************************************************** **** GETTER ***************************************************************** *****************************************************************************/ /** Get command name. */ getName(): string; /** Get parent command. */ getParent(): TParentCommand; /** * Get parent command from global executed command. * Be sure, to call this method only inside an action handler. Unless this or any child command was executed, * this method returns always undefined. */ getGlobalParent(): Command | undefined; /** Get main command. */ getMainCommand(): Command; /** Get command name aliases. */ getAliases(): string[]; /** * Get full command path. * * @param name Override the main command name. */ getPath(name?: string): string; /** Get arguments definition. E.g: */ getArgsDefinition(): string | undefined; /** * Get argument by name. * * @param name Name of the argument. */ getArgument(name: string): Argument | undefined; /** Get arguments. */ getArguments(): Argument[]; /** Check if command has arguments. */ hasArguments(): boolean; /** Get command version. */ getVersion(): string | undefined; /** Get help handler method. */ private getVersionHandler; /** Get command description. */ getDescription(): string; /** Get auto generated command usage. */ getUsage(): string; private getRequiredOptionsDefinition; /** Get short command description. This is the first line of the description. */ getShortDescription(): string; /** Get original command-line arguments. */ getRawArgs(): string[]; /** Get all arguments defined after the double dash. */ getLiteralArgs(): string[]; /** Output generated help without exiting. */ showVersion(): void; /** Returns command name, version and meta data. */ getLongVersion(): string; /** Outputs command name, version and meta data. */ showLongVersion(): void; /** Output generated help without exiting. */ showHelp(options?: HelpOptions): void; /** Get generated help. */ getHelp(options?: HelpOptions): string; /** Get help handler method. */ private getHelpHandler; private exit; /***************************************************************************** **** Options GETTER ********************************************************* *****************************************************************************/ /** * Checks whether the command has options or not. * * @param hidden Include hidden options. */ hasOptions(hidden?: boolean): boolean; /** * Get options. * * @param hidden Include hidden options. */ getOptions(hidden?: boolean): Option[]; /** * Get base options. * * @param hidden Include hidden options. */ getBaseOptions(hidden?: boolean): Option[]; /** * Get global options. * * @param hidden Include hidden options. */ getGlobalOptions(hidden?: boolean): Option[]; /** * Checks whether the command has an option with given name or not. * * @param name Name of the option. Must be in param-case. * @param hidden Include hidden options. */ hasOption(name: string, hidden?: boolean): boolean; /** * Get option by name. * * @param name Name of the option. Must be in param-case. * @param hidden Include hidden options. */ getOption(name: string, hidden?: boolean): Option | undefined; /** * Get base option by name. * * @param name Name of the option. Must be in param-case. * @param hidden Include hidden options. */ getBaseOption(name: string, hidden?: boolean): Option | undefined; /** * Get global option from parent commands by name. * * @param name Name of the option. Must be in param-case. * @param hidden Include hidden options. */ getGlobalOption(name: string, hidden?: boolean): Option | undefined; /** * Remove option by name. * * @param name Name of the option. Must be in param-case. */ removeOption(name: string): Option | undefined; /** * Checks whether the command has sub-commands or not. * * @param hidden Include hidden commands. */ hasCommands(hidden?: boolean): boolean; /** * Get commands. * * @param hidden Include hidden commands. */ getCommands(hidden?: boolean): Array>; /** * Get base commands. * * @param hidden Include hidden commands. */ getBaseCommands(hidden?: boolean): Array>; /** * Get global commands. * * @param hidden Include hidden commands. */ getGlobalCommands(hidden?: boolean): Array>; /** * Checks whether a child command exists by given name or alias. * * @param name Name or alias of the command. * @param hidden Include hidden commands. */ hasCommand(name: string, hidden?: boolean): boolean; /** * Get command by name or alias. * * @param name Name or alias of the command. * @param hidden Include hidden commands. */ getCommand>(name: string, hidden?: boolean): TCommand | undefined; /** * Get base command by name or alias. * * @param name Name or alias of the command. * @param hidden Include hidden commands. */ getBaseCommand>(name: string, hidden?: boolean): TCommand | undefined; /** * Get global command by name or alias. * * @param name Name or alias of the command. * @param hidden Include hidden commands. */ getGlobalCommand>(name: string, hidden?: boolean): TCommand | undefined; /** * Remove sub-command by name or alias. * * @param name Name or alias of the command. */ removeCommand(name: string): Command | undefined; /** Get types. */ getTypes(): Array; /** Get base types. */ getBaseTypes(): Array; /** Get global types. */ getGlobalTypes(): Array; /** * Get type by name. * * @param name Name of the type. */ getType(name: string): TypeDef | undefined; /** * Get base type by name. * * @param name Name of the type. */ getBaseType(name: string): TypeDef | undefined; /** * Get global type by name. * * @param name Name of the type. */ getGlobalType(name: string): TypeDef | undefined; /** Get completions. */ getCompletions(): Completion[]; /** Get base completions. */ getBaseCompletions(): Completion[]; /** Get global completions. */ getGlobalCompletions(): Completion[]; /** * Get completion by name. * * @param name Name of the completion. */ getCompletion(name: string): Completion | undefined; /** * Get base completion by name. * * @param name Name of the completion. */ getBaseCompletion(name: string): Completion | undefined; /** * Get global completions by name. * * @param name Name of the completion. */ getGlobalCompletion(name: string): Completion | undefined; /** * Checks whether the command has environment variables or not. * * @param hidden Include hidden environment variable. */ hasEnvVars(hidden?: boolean): boolean; /** * Get environment variables. * * @param hidden Include hidden environment variable. */ getEnvVars(hidden?: boolean): EnvVar[]; /** * Get base environment variables. * * @param hidden Include hidden environment variable. */ getBaseEnvVars(hidden?: boolean): EnvVar[]; /** * Get global environment variables. * * @param hidden Include hidden environment variable. */ getGlobalEnvVars(hidden?: boolean): EnvVar[]; /** * Checks whether the command has an environment variable with given name or not. * * @param name Name of the environment variable. * @param hidden Include hidden environment variable. */ hasEnvVar(name: string, hidden?: boolean): boolean; /** * Get environment variable by name. * * @param name Name of the environment variable. * @param hidden Include hidden environment variable. */ getEnvVar(name: string, hidden?: boolean): EnvVar | undefined; /** * Get base environment variable by name. * * @param name Name of the environment variable. * @param hidden Include hidden environment variable. */ getBaseEnvVar(name: string, hidden?: boolean): EnvVar | undefined; /** * Get global environment variable by name. * * @param name Name of the environment variable. * @param hidden Include hidden environment variable. */ getGlobalEnvVar(name: string, hidden?: boolean): EnvVar | undefined; /** Checks whether the command has examples or not. */ hasExamples(): boolean; /** Get all examples. */ getExamples(): Example[]; /** Checks whether the command has an example with given name or not. */ hasExample(name: string): boolean; /** Get example with given name. */ getExample(name: string): Example | undefined; private getHelpOption; } interface ParseContext extends ParseFlagsContext> { actions: Array; env: Record; } interface ParseOptionsOptions { stopEarly?: boolean; stopOnUnknown?: boolean; dotted?: boolean; } export {}; //# sourceMappingURL=command.d.ts.map