Skip to content

gunshi / default / CommandEnvironment

Interface: CommandEnvironment<A>

Command environment.

Type Parameters

Type ParameterDefault type
A extends ArgsArgs

Properties

PropertyTypeDescription
cwdundefined | stringCurrent working directory. See CommandOptions.cwd
descriptionundefined | stringCommand description. See CommandOptions.description
leftMarginnumberLeft margin of the command output. Default 2 See CommandOptions.leftMargin
middleMarginnumberMiddle margin of the command output. Default 10 See CommandOptions.middleMargin
nameundefined | stringCommand name. See CommandOptions.name
renderHeaderundefined | null | (ctx) => Promise<string>Render function the header section in the command usage.
renderUsageundefined | null | (ctx) => Promise<string>Render function the command usage.
renderValidationErrorsundefined | null | (ctx, error) => Promise<string>Render function the validation errors.
subCommands| undefined | Map<string, | Command<any> | LazyCommand<any>>Sub commands. See CommandOptions.subCommands
usageOptionTypebooleanWhether to display the usage option type. Default false See CommandOptions.usageOptionType
usageOptionValuebooleanWhether to display the option value. Default true See CommandOptions.usageOptionValue
usageSilentbooleanWhether to display the command usage. Default false See CommandOptions.usageSilent
versionundefined | stringCommand version. See CommandOptions.version

Released under the MIT License.