Skip to content

gunshi / default / CommandEnvironment

Interface: CommandEnvironment<Options>

Command environment.

Type Parameters

Type ParameterDefault type
Options extends ArgOptionsArgOptions

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
usageSilentbooleanWhether to display the command usage. Default false See
versionundefined | stringCommand version. See CommandOptions.version

Released under the MIT License.