Documentation
¶
Index ¶
- func Bold(s string) string
- func BoldGreen(s string) string
- func BoldRed(s string) string
- func Error(s string) string
- func FormatStatus(status int) string
- func Hint(w io.Writer, message string)
- func HintCommand(w io.Writer, desc, cmd string)
- func ID(s string) string
- func Muted(s string) string
- func NewTable(w io.Writer) table.Writer
- func NoResults(w io.Writer, message string)
- func StatusColor(status int) text.Color
- func StatusRowPainter(statusColIdx int) func(row table.Row) text.Colors
- func StyleLight() table.Style
- func StyleSimple() table.Style
- func Success(s string) string
- func Summary(w io.Writer, count int, singular, plural string)
- func UnknownCommandError(unknown string, validCommands []string) error
- func UnknownSubcommandError(prefix, unknown string, validCommands []string) error
- func Warning(s string) string
- type ColorMode
- type OutputConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoldGreen ¶ added in v0.1.3
BoldGreen returns text with bold+green formatting for inline diff emphasis.
func BoldRed ¶ added in v0.1.3
BoldRed returns text with bold+red formatting for inline diff emphasis.
func FormatStatus ¶
FormatStatus returns a colored status code string.
func HintCommand ¶
HintCommand prints a command suggestion with description.
func StatusColor ¶
StatusColor returns the appropriate color for an HTTP status code.
func StatusRowPainter ¶
StatusRowPainter returns a row painter function that colors rows based on HTTP status. statusColIdx is the 0-based index of the status column in the row.
func StyleLight ¶
StyleLight returns the primary table style with Unicode box-drawing characters.
func StyleSimple ¶
StyleSimple returns a plain ASCII style for non-TTY output.
func UnknownCommandError ¶
UnknownCommandError returns an error for an unknown command with a "did you mean" suggestion if a close match is found.
func UnknownSubcommandError ¶
UnknownSubcommandError returns an error for an unknown subcommand with a "did you mean" suggestion if a close match is found.
Types ¶
type OutputConfig ¶
var Output *OutputConfig
func (*OutputConfig) ColorsEnabled ¶
func (o *OutputConfig) ColorsEnabled() bool
func (*OutputConfig) IsTTY ¶
func (o *OutputConfig) IsTTY() bool
IsTTY returns true if output should be formatted for a terminal.