Documentation ¶
Index ¶
- func AllCommandsSectionHelp(file *os.File, cur *section.SectionT, helpInfo HelpInfo) command.Action
- func ConditionallyEnableColor(pf command.PassedFlags, file *os.File) (gocolor.Color, error)
- func DetailedCommandHelp(file *os.File, cur *command.Command, helpInfo HelpInfo) command.Action
- func DetailedSectionHelp(file *os.File, cur *section.SectionT, _ HelpInfo) command.Action
- func OutlineCommandHelp(file *os.File, cur *command.Command, helpInfo HelpInfo) command.Action
- func OutlineSectionHelp(file *os.File, _ *section.SectionT, hi HelpInfo) command.Action
- type CommandHelp
- type HelpFlagMapping
- type HelpInfo
- type SectionHelp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllCommandsSectionHelp ¶ added in v0.0.13
func ConditionallyEnableColor ¶
SetColor looks for a passed --color flag with an underlying string value. If it exists and is set to "true", or if it exists, is set to "auto", and the passed file is a TTY, an enabled Color is returned.
func DetailedCommandHelp ¶
func DetailedSectionHelp ¶
func OutlineCommandHelp ¶
Types ¶
type CommandHelp ¶
type HelpFlagMapping ¶
type HelpFlagMapping struct { Name string CommandHelp CommandHelp SectionHelp SectionHelp }
HelpFlagMapping adds a new option to your --help flag
func BuiltinHelpFlagMappings ¶
func BuiltinHelpFlagMappings() []HelpFlagMapping
BuiltinHelpFlagMappings is a convenience method that contains help flag mappings built into warg. Feel free to use it as a base to custimize help functions for your users
type HelpInfo ¶
type HelpInfo struct { // AppName as defined by warg.New() AppName string // Path passed either to a command or a section Path []string // AvailableFlags for the current section or commmand, including inherted flags from parent sections. // All flags are Resolved if possible (i.e., flag.SetBy != "") AvailableFlags flag.FlagMap // RootSection of the app. Especially useful for printing all sections and commands RootSection section.SectionT }
HelpInfo lists common information available to a help function
Click to show internal directories.
Click to hide internal directories.