Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInvalidAppSpecError ¶
NewInvalidAppSpecError creates a new error indicating that an app spec is invalid.
func NewInvalidCommandSpecError ¶
NewInvalidCommandSpecError creates a new error indicating that a command spec is invalid.
Types ¶
type App ¶
type App struct {
Name string `json:"name" yaml:"name"`
Description string `json:"description" yaml:"description"`
Commands []*Command `json:"commands" yaml:"commands"`
}
An App specifies a complete clic application.
func NewAppSpec ¶
NewAppSpec creates a new App from the provided spec.
type Command ¶
type Command struct {
Name string `json:"name" yaml:"name"`
Description string `json:"description" yaml:"description"`
Provider provider.Provider `json:"-" yaml:"-"`
Subcommands []*Command `json:"subcommands,omitempty" yaml:"subcommands,omitempty"`
}
A Command specifes an action or a set of subcommands.
func NewCommandSpec ¶
NewCommandSpec creates a new Command from the provided spec.
func (*Command) CLICommand ¶
CLICommand creates a CLI command for this command.
func (*Command) UnmarshalJSON ¶
UnmarshalJSON unmarshals the specified JSON data into the command.
func (*Command) UnmarshalYAML ¶
UnmarshalYAML unmarshals the specified YAML data into the command.
Click to show internal directories.
Click to hide internal directories.