Documentation
¶
Index ¶
- func AddCommandGroups(rootCommand *cobra.Command, groups CommandGroups) *cobra.Command
- func CommandGroupHelpFunc(rootCommand *cobra.Command, groups CommandGroups, ...) func(*cobra.Command, []string)
- func CommandGroupUsageFunc(groups CommandGroups, templateFuncs *template.FuncMap) func(*cobra.Command) error
- func PrintTemplate(out io.Writer, text string, data interface{}, templateFuncs *template.FuncMap) error
- func PrintTrimmedMultilineString(str string, out io.Writer)
- type CommandGroup
- type CommandGroups
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommandGroups ¶
func AddCommandGroups(rootCommand *cobra.Command, groups CommandGroups) *cobra.Command
AddCommandGroups adds CommandGroups to a given cobra Command. A side effact of calling this function is that subcommands will no longer be able to use their own usage or help funcs.
func CommandGroupHelpFunc ¶
func CommandGroupHelpFunc(rootCommand *cobra.Command, groups CommandGroups, templateFuncs *template.FuncMap) func(*cobra.Command, []string)
CommandGroupHelpFunc returns a HelpFunc a root level command can use.
func CommandGroupUsageFunc ¶
func CommandGroupUsageFunc(groups CommandGroups, templateFuncs *template.FuncMap) func(*cobra.Command) error
CommandGroupUsageFunc returns a UsageFunc a root level command can use.
func PrintTemplate ¶
func PrintTemplate(out io.Writer, text string, data interface{}, templateFuncs *template.FuncMap) error
PrintTemplate prints the provided template to the output writer.
func PrintTrimmedMultilineString ¶
PrintTrimmedMultilineString does just that.
Types ¶
type CommandGroup ¶
CommandGroup is a logical grouping of commands
type CommandGroups ¶
type CommandGroups []CommandGroup
CommandGroups is a list of CommandGroups.
func (CommandGroups) CalculateMinWidth ¶
func (groups CommandGroups) CalculateMinWidth() int
CalculateMinWidth gets the minimum width required for all command names.
Click to show internal directories.
Click to hide internal directories.