Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Format to use for output. One of 'json', 'yaml', 'pretty' Format string // Verbose ... Verbose bool )
Functions ¶
func Exit ¶
func Exit(format string, args ...interface{})
Exit func display an error message on stderr and exit 1
func FormatOutput ¶
func FormatOutput(v interface{}, prettyFormatter func([]byte))
FormatOutput autmatically formats json based output based on user choice. when selected formatter is "pretty", call prettyFormatter callback.
func FormatOutputDef ¶
func FormatOutputDef(v interface{})
FormatOutputDef autmatically formats json based output based on user choice. uses yamlFormatter as pretty formatter.
func FormatOutputError ¶
func FormatOutputError(data []byte)
FormatOutputError prints the "message" field of an API return or falls back on FormatOutputDef if the field does not exist
func WrongUsage ¶
WrongUsage display a wrong usage error, shows the help and exit 1
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.