Documentation ¶
Index ¶
- func ConditionallyEnableColor(pf flag.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 ConditionallyEnableColor ¶ added in v0.0.5
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 ¶ added in v0.0.8
func DetailedSectionHelp ¶ added in v0.0.8
func OutlineCommandHelp ¶ added in v0.0.10
Types ¶
type CommandHelp ¶
type HelpFlagMapping ¶ added in v0.0.10
type HelpFlagMapping struct { Name string CommandHelp CommandHelp SectionHelp SectionHelp }
HelpFlagMapping adds a new option to your --help flag
func BuiltinHelpFlagMappings ¶ added in v0.0.10
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 section or commmand. // 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.