Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Indent indicates depth of one indent level // (the number of spaces inserted). Indent = 2 // ExpandsSubCommand defines whether options and flags // of sub-commands are displayed in the top level help // message. ExpandsSubCommand = true // TitleColor specifies color of title // such as `subcommand`. TitleColor = "yellow" // FlagColor specifies color of flags FlagColor = "green" )
Functions ¶
Types ¶
type OutputFormatter ¶
type OutputFormatter struct { Indent int // contains filtered or unexported fields }
OutputFormatter is a formatter that constructs help messages in a structured way.
func (*OutputFormatter) AddFlag ¶
func (o *OutputFormatter) AddFlag(flg *flag.Flag)
AddFlag adds group name which is followd by multiple options or flags
func (*OutputFormatter) AddSubCommand ¶
func (o *OutputFormatter) AddSubCommand(subCommand string)
AddSubCommand adds subcommand
func (*OutputFormatter) CloseGroup ¶
func (o *OutputFormatter) CloseGroup()
CloseGroup closes one group. which break line and unshift indent
func (*OutputFormatter) InitGroup ¶
func (o *OutputFormatter) InitGroup(groupName string)
InitGroup adds group name which is followd by multiple options or flags
func (*OutputFormatter) Print ¶
func (o *OutputFormatter) Print()
Print prints constructed help message
Click to show internal directories.
Click to hide internal directories.