Documentation ¶
Index ¶
- Constants
- type Command
- type Func
- type HelpOption
- func OptionColor(i bool) HelpOption
- func OptionCommands(i map[string]Command) HelpOption
- func OptionErr(i string) HelpOption
- func OptionFlags(i []string) HelpOption
- func OptionFormat(i string) HelpOption
- func OptionHeader(i string) HelpOption
- func OptionHelp(i string) HelpOption
- func OptionHint(i string) HelpOption
- func OptionShowHelp(i bool) HelpOption
- func OptionTemplate(i string) HelpOption
- func OptionUsages(i []string) HelpOption
- type HelpOptions
Constants ¶
const BasicHelpTemplate = `` /* 451-byte string literal not displayed */
BasicHelpTemplate is the current view template of the help output.
const CommandHelpTemplate = `` /* 858-byte string literal not displayed */
CommandHelpTemplate represents a template for rendering the help for commands and subcommands.
const HelpTemplateFormat = ` {{green .Name}} {{.Synopsis}}`
HelpTemplateFormat defines a basic format for templating a help template.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface {
Synopsis() string
}
Command represents an abstraction of command.
type Func ¶
type Func func(...HelpOption) (string, error)
Func is the type of the function that is responsible for generating the help output when the CLI must show the general help text.
type HelpOption ¶
type HelpOption func(HelpOptions)
HelpOption captures a tweak that can be applied to the Help.
func OptionColor ¶
func OptionColor(i bool) HelpOption
OptionColor allows the setting a color option to configure the group.
func OptionCommands ¶
func OptionCommands(i map[string]Command) HelpOption
OptionCommands allows the setting a commands option to configure the group.
func OptionErr ¶
func OptionErr(i string) HelpOption
OptionErr allows the setting a hint option to configure the group.
func OptionFlags ¶
func OptionFlags(i []string) HelpOption
OptionFlags allows the setting a commands option to configure the group.
func OptionFormat ¶
func OptionFormat(i string) HelpOption
OptionFormat allows the setting a format option to configure the group.
func OptionHeader ¶
func OptionHeader(i string) HelpOption
OptionHeader allows the setting a header option to configure the group.
func OptionHelp ¶
func OptionHelp(i string) HelpOption
OptionHelp allows the setting a hint option to configure the group.
func OptionHint ¶
func OptionHint(i string) HelpOption
OptionHint allows the setting a hint option to configure the group.
func OptionShowHelp ¶
func OptionShowHelp(i bool) HelpOption
OptionShowHelp allows the setting a color option to configure the group.
func OptionTemplate ¶
func OptionTemplate(i string) HelpOption
OptionTemplate allows the setting a template option to configure the group.
func OptionUsages ¶
func OptionUsages(i []string) HelpOption
OptionUsages allows the setting a commands option to configure the group.
type HelpOptions ¶
type HelpOptions interface { SetHeader(string) SetHint(string) SetHelp(string) SetErr(string) SetCommands(map[string]Command) SetFlags([]string) SetUsages([]string) SetFormat(string) SetColor(bool) SetTemplate(string) SetShowHelp(bool) }
HelpOptions represents a way to set optional values to a autocomplete option. The HelpOptions shows what options are available to change.