Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendFlag ¶
AppendFlag adds the -format flag to the provided flagset, and populates the referenced Printer interface with a properly configured printer.
func AppendFlagWithCustomPretty ¶
func AppendFlagWithCustomPretty(p *Printer, fs *flag.FlagSet, cp CustomPrettyFunc)
AppendFlagWithCustomPretty is the same as AppendFlag, however it also allows a custom pretty function to be specified. A custom pretty function can be used to override the pretty print logic that normally ships with this package. Its intended use is to allow for the adoption of cliprinter while still retaining backwards compatibility with the legacy/bespoke pretty print output.
Types ¶
type CustomPrettyFunc ¶
type CustomPrettyFunc func(...interface{}) error
CustomPrettyFunc is used to provide a custom function for pretty printing messages. The intent is to provide a migration pathway for pre-existing CLI code, such that this code can supply a custom pretty printer that mirrors its current behavior, but still be able to gain formatter functionality for other outputs.
type FormatterFlag ¶
type FormatterFlag struct {
// contains filtered or unexported fields
}
func (*FormatterFlag) Set ¶
func (f *FormatterFlag) Set(formatStr string) error
func (*FormatterFlag) String ¶
func (f *FormatterFlag) String() string