Documentation
¶
Index ¶
- Variables
- func Execute(cnf *config.Config) error
- type Any
- type Application
- type Argument
- type CleanString
- type Command
- type CommandName
- type Definition
- type Example
- type Formatter
- type JSONListFormatter
- type List
- type MDListFormatter
- type Namespace
- type Option
- type RawListFormatter
- type TXTListFormatter
- type YesNo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HelpOption = Option{ Name: "--help", Shortcut: "-h", AcceptValue: false, IsValueRequired: false, IsMultiple: false, Description: "Display this help message", Default: Any{false}, Hidden: false, } VerboseOption = Option{ Name: "--verbose", Shortcut: "-v|vv|vvv", AcceptValue: false, IsValueRequired: false, IsMultiple: false, Description: "Increase the verbosity of messages", Default: Any{false}, Hidden: false, } VersionOption = Option{ Name: "--version", Shortcut: "-V", AcceptValue: false, IsValueRequired: false, IsMultiple: false, Description: "Display this application version", Default: Any{false}, Hidden: false, } YesOption = Option{ Name: "--yes", Shortcut: "-y", AcceptValue: false, IsValueRequired: false, IsMultiple: false, Description: "Answer \"yes\" to confirmation questions; " + "accept the default value for other questions; disable interaction", Default: Any{false}, Hidden: false, } AnsiOption = Option{ Name: "--ansi", Shortcut: "", AcceptValue: false, IsValueRequired: false, IsMultiple: false, Description: "Force ANSI output", Default: Any{false}, Hidden: true, } NoAnsiOption = Option{ Name: "--no-ansi", Shortcut: "", AcceptValue: false, IsValueRequired: false, IsMultiple: false, Description: "Disable ANSI output", Default: Any{false}, Hidden: true, } NoOption = Option{ Name: "--no", Shortcut: "-n", AcceptValue: false, IsValueRequired: false, IsMultiple: false, Description: "Answer \"no\" to confirmation questions; " + "accept the default value for other questions; disable interaction", Default: Any{false}, Hidden: true, } QuietOption = Option{ Name: "--quiet", Shortcut: "-q", AcceptValue: false, IsValueRequired: false, IsMultiple: false, Description: "Do not output any message", Default: Any{false}, Hidden: true, } )
Functions ¶
Types ¶
type Any ¶
type Any struct {
// contains filtered or unexported fields
}
func (Any) MarshalJSON ¶
func (*Any) UnmarshalJSON ¶
type Application ¶
type Argument ¶
type Argument struct {
Name string `json:"name"`
IsRequired YesNo `json:"is_required"`
IsArray YesNo `json:"is_array"`
Description CleanString `json:"description"`
Default Any `json:"default"`
}
type CleanString ¶
type CleanString string
func (*CleanString) MarshalJSON ¶
func (s *CleanString) MarshalJSON() ([]byte, error)
func (CleanString) String ¶
func (s CleanString) String() string
func (*CleanString) UnmarshalJSON ¶
func (s *CleanString) UnmarshalJSON(text []byte) error
type Command ¶
type Command struct {
Name CommandName `json:"name"`
Usage []string `json:"usage"`
Aliases []string `json:"aliases"`
Description CleanString `json:"description"`
Help CleanString `json:"help"`
Examples []Example `json:"examples"`
Definition Definition `json:"definition"`
Hidden bool `json:"hidden"`
}
type CommandName ¶
func (*CommandName) ContainsNamespace ¶
func (n *CommandName) ContainsNamespace() bool
func (*CommandName) MarshalJSON ¶
func (n *CommandName) MarshalJSON() ([]byte, error)
func (*CommandName) String ¶
func (n *CommandName) String() string
func (*CommandName) UnmarshalJSON ¶
func (n *CommandName) UnmarshalJSON(text []byte) error
type Definition ¶
type Definition struct {
Arguments *orderedmap.OrderedMap[string, Argument] `json:"arguments"`
Options *orderedmap.OrderedMap[string, Option] `json:"options"`
}
type Example ¶
type Example struct {
Commandline string `json:"commandline"`
Description CleanString `json:"description"`
}
type JSONListFormatter ¶
type JSONListFormatter struct{}
type List ¶
type List struct {
Application Application `json:"application"`
Commands []*Command `json:"commands"`
Namespace string `json:"namespace,omitempty"`
Namespaces []Namespace `json:"namespaces,omitempty"`
}
func (*List) AddCommand ¶
func (*List) DescribesNamespace ¶
type MDListFormatter ¶
type MDListFormatter struct{}
type Option ¶
type Option struct {
Name string `json:"name"`
Shortcut string `json:"shortcut"`
AcceptValue YesNo `json:"accept_value"`
IsValueRequired YesNo `json:"is_value_required"`
IsMultiple YesNo `json:"is_multiple"`
Description CleanString `json:"description"`
Default Any `json:"default"`
Hidden bool `json:"hidden"`
}
func NoInteractionOption ¶
type RawListFormatter ¶
type RawListFormatter struct{}
type TXTListFormatter ¶
type TXTListFormatter struct{}
Click to show internal directories.
Click to hide internal directories.