Documentation ¶
Index ¶
- Constants
- func BuildCmd(cmd *cobra.Command) string
- func PrintConfig(cmd *cobra.Command, prefix string)
- func PrintExamples(cmd *cobra.Command, examples ...string) string
- func PrintFlagEnv(prefix string, flag string) string
- type Help
- func (h *Help) AttachCommands(cmd *cobra.Command) *cobra.Command
- func (h *Help) CmdHelp(cmd *cobra.Command, args []string) error
- func (h *Help) ExtendedHelp()
- func (h *Help) GetCmd() *cobra.Command
- func (h *Help) InitArgs(_ *cobra.Command, _ []string) error
- func (h *Help) PrintConfig(cmd *cobra.Command)
- func (h *Help) SetCommand(text string)
- func (h *Help) SetEnvPrefix(text string)
- func (h *Help) SetExamples(text string)
- func (h *Help) SetFlagHelpTemplate(text string)
- func (h *Help) SetHelpSummary(text string)
- func (h *Help) SetHelpTemplate(text string)
- func (h *Help) SetReadMe(text string)
- func (h *Help) SetUsageTemplate(text string)
Constants ¶
View Source
const DHT = `{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}`
View Source
const DUT1 = `` /* 280-byte string literal not displayed */
View Source
const DUT2 = `` /* 375-byte string literal not displayed */
View Source
const DefaultFlagHelpTemplate = `` /* 132-byte string literal not displayed */
View Source
const DefaultHelpSummary = `
DefaultBinaryName -
`
View Source
const DefaultHelpTemplate = `
{{with (or .Long .Short)}}{{. | trimTrailingWhitespaces}}
{{end}}{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}`
View Source
const DefaultUsageTemplate = `` /* 831-byte string literal not displayed */
View Source
const Group = "Help"
Variables ¶
This section is empty.
Functions ¶
func PrintConfig ¶
func PrintFlagEnv ¶
Types ¶
type Help ¶
type Help struct { Error error Command string HelpTemplate string UsageTemplate string FlagHelpTemplate string HelpSummary string EnvPrefix string ReadMe string Examples string SelfCmd *cobra.Command // contains filtered or unexported fields }
func (*Help) ExtendedHelp ¶
func (h *Help) ExtendedHelp()
func (*Help) PrintConfig ¶
func (*Help) SetCommand ¶
func (*Help) SetEnvPrefix ¶
func (*Help) SetExamples ¶
func (*Help) SetFlagHelpTemplate ¶
func (*Help) SetHelpSummary ¶
func (*Help) SetHelpTemplate ¶
func (*Help) SetUsageTemplate ¶
Click to show internal directories.
Click to hide internal directories.