Documentation
¶
Index ¶
- Variables
- func CaptureOutput(f func()) string
- func CaptureOutputErr(f func() error) (string, error)
- func FormatCommandName(name string, noColor bool) string
- func FormatConfirmation(msg string, noColor bool) string
- func FormatExample(example string, noColor bool) string
- func FormatJSONExample(json string, noColor bool) string
- func FormatNewValue(value string, noColor bool) string
- func FormatOldValue(value string, noColor bool) string
- func FormatOptionalFlag(flag string, description string, noColor bool) string
- func FormatPrompt(msg string, noColor bool) string
- func FormatRequiredFlag(flag string, description string, noColor bool) string
- func FormatSuccess(msg string, noColor bool) string
- func FormatUID(uid string, noColor bool) string
- func PrintError(format string, noColor bool, args ...interface{})
- func PrintInfo(format string, noColor bool, args ...interface{})
- func PrintOutput[T OutputFields](data []T, format string, noColor bool) error
- func PrintResourceCreated(resourceType, uid string, noColor bool)
- func PrintResourceDeleted(resourceType, uid string, immediate, noColor bool)
- func PrintResourceSuccess(resourceType, action, uid string, noColor bool)
- func PrintResourceUpdated(resourceType, uid string, noColor bool)
- func PrintSuccess(format string, noColor bool, args ...interface{})
- func PrintWarning(format string, noColor bool, args ...interface{})
- func StripANSIColors(s string) string
- type Output
- type OutputFields
Constants ¶
This section is empty.
Variables ¶
var UsePrettyTables = false
UsePrettyTables controls whether to use the enhanced table rendering Default is false for backward compatibility with tests
Functions ¶
func CaptureOutput ¶
func CaptureOutput(f func()) string
captureOutput captures and returns any output written to stdout during execution of f.
func CaptureOutputErr ¶
captureOutputErr is a helper function to capture stdout output and return any error
func FormatCommandName ¶
FormatCommandName colorizes command names
func FormatConfirmation ¶
FormatConfirmation returns a formatted confirmation prompt
func FormatExample ¶
FormatExample colorizes command examples in help text
func FormatJSONExample ¶
FormatJSONExample formats JSON examples in help text
func FormatNewValue ¶ added in v0.3.4
func FormatOldValue ¶ added in v0.3.4
Helper functions to format old and new values
func FormatOptionalFlag ¶
FormatOptionalFlag formats optional flags in help text
func FormatPrompt ¶
FormatPrompt returns a formatted input prompt
func FormatRequiredFlag ¶
FormatRequiredFlag highlights required flags in help text
func FormatSuccess ¶
FormatSuccess returns a formatted success string
func PrintError ¶
PrintError prints an error message with red color
func PrintOutput ¶
func PrintOutput[T OutputFields](data []T, format string, noColor bool) error
PrintOutput formats data in the specified output style
func PrintResourceCreated ¶
PrintResourceCreated prints a standardized resource creation message
func PrintResourceDeleted ¶
PrintResourceDeleted prints a standardized resource deletion message
func PrintResourceSuccess ¶
PrintResourceSuccess prints a success message for a resource operation
func PrintResourceUpdated ¶
PrintResourceUpdated prints a standardized resource update message
func PrintSuccess ¶
PrintSuccess prints a success message with green color and a checkmark
func PrintWarning ¶
PrintWarning prints a warning message with yellow color
func StripANSIColors ¶
stripANSIColors removes ANSI color codes from a string
Types ¶
type OutputFields ¶
type OutputFields interface {
any
}
OutputFields is a marker interface for output-formattable types