Documentation
¶
Index ¶
- func NotFound(message string, alternatives []string) types.ErrorWithAlternatives
- type Command
- func (c *Command) AddArgument(arg *input.InputArgument) *Command
- func (c *Command) AddOption(option *input.InputOption) *Command
- func (c *Command) AddUsage(usage string) *Command
- func (c *Command) ApplicationDefinition() *input.InputDefinition
- func (c *Command) Arguments() map[string]input.InputType
- func (c *Command) ArrayArgument(name string) ([]string, error)
- func (c *Command) ArrayOption(name string) ([]string, error)
- func (c *Command) BoolOption(name string) (bool, error)
- func (c *Command) DefineArgument(name string, mode input.InputArgumentMode, description string, ...) *Command
- func (c *Command) DefineOption(name string, shortcut string, mode input.InputOptionMode, description string, ...) *Command
- func (c *Command) Definition() *input.InputDefinition
- func (c *Command) Describe(output output.OutputInterface, options uint)
- func (c *Command) Fail(e string) (int, error)
- func (c *Command) Input() input.InputInterface
- func (c *Command) IsEnabled() bool
- func (c *Command) MergeApplication(mergeArgs bool)
- func (c *Command) Meta() any
- func (c *Command) NativeDefinition() *input.InputDefinition
- func (c *Command) Options() map[string]input.InputType
- func (c *Command) Output() output.OutputInterface
- func (c *Command) ProcessedHelp() string
- func (c *Command) Run(i input.InputInterface, o output.OutputInterface) (int, error)
- func (c *Command) SetAliases(aliases []string) *Command
- func (c *Command) SetApplicationDefinition(definition *input.InputDefinition)
- func (c *Command) SetDefinition(definition *input.InputDefinition)
- func (c *Command) SetDescription(description string) *Command
- func (c *Command) SetHelp(help string) *Command
- func (c *Command) SetHidden(hidden bool) *Command
- func (c *Command) SetInitializer(initializer CommandInitializer)
- func (c *Command) SetInteracter(interactor CommandInteracter)
- func (c *Command) SetMeta(meta any)
- func (c *Command) SetName(name string) *Command
- func (c *Command) StringArgument(name string) (string, error)
- func (c *Command) StringOption(name string) (string, error)
- func (c *Command) Synopsis(short bool) string
- func (c *Command) Usages() []string
- type CommandHandle
- type CommandInitializer
- type CommandInteracter
- type CommandNotFoundError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
type Command struct { Handle CommandHandle Name string Description string Aliases []string Help string Hidden bool IgnoreValidationErrors bool // contains filtered or unexported fields }
func (*Command) AddArgument ¶
func (c *Command) AddArgument(arg *input.InputArgument) *Command
func (*Command) ApplicationDefinition ¶
func (c *Command) ApplicationDefinition() *input.InputDefinition
func (*Command) DefineArgument ¶ added in v0.4.2
func (c *Command) DefineArgument(name string, mode input.InputArgumentMode, description string, defaultValue input.InputType, validator input.InputValidator) *Command
func (*Command) DefineOption ¶ added in v0.4.2
func (*Command) Definition ¶
func (c *Command) Definition() *input.InputDefinition
func (*Command) Input ¶
func (c *Command) Input() input.InputInterface
func (*Command) MergeApplication ¶
func (*Command) NativeDefinition ¶
func (c *Command) NativeDefinition() *input.InputDefinition
func (*Command) Output ¶
func (c *Command) Output() output.OutputInterface
func (*Command) ProcessedHelp ¶
func (*Command) Run ¶
func (c *Command) Run(i input.InputInterface, o output.OutputInterface) (int, error)
func (*Command) SetAliases ¶
func (*Command) SetApplicationDefinition ¶
func (c *Command) SetApplicationDefinition(definition *input.InputDefinition)
func (*Command) SetDefinition ¶
func (c *Command) SetDefinition(definition *input.InputDefinition)
func (*Command) SetDescription ¶
func (*Command) SetInitializer ¶
func (c *Command) SetInitializer(initializer CommandInitializer)
func (*Command) SetInteracter ¶
func (c *Command) SetInteracter(interactor CommandInteracter)
type CommandHandle ¶
type CommandInitializer ¶
type CommandInitializer func(input input.InputInterface, output output.OutputInterface)
type CommandInteracter ¶
type CommandInteracter func(input input.InputInterface, output output.OutputInterface)
type CommandNotFoundError ¶
type CommandNotFoundError struct {
// contains filtered or unexported fields
}
func (*CommandNotFoundError) Alternatives ¶
func (e *CommandNotFoundError) Alternatives() []string
func (*CommandNotFoundError) Error ¶
func (e *CommandNotFoundError) Error() string
Click to show internal directories.
Click to hide internal directories.