Documentation
¶
Index ¶
- Variables
- func Blue(text string) string
- func Bold(text string) string
- func BrightRed(text string) string
- func BrightYellow(text string) string
- func Color() aurora.Aurora
- func ColorizeJSON(json string) string
- func Cyan(text string) string
- func Faint(text string) string
- func Green(text string) string
- func Hyperlink(url, text string) string
- func InitConsole()
- func Initialize(shouldDisableColors bool)
- func Italic(text string) string
- func Magenta(text string) string
- func ProgressBar[T comparable](desc string, items []T, fn func(int, T) error) error
- func Red(text string) string
- func Spinner(text string, fn func() error) error
- func URL(text string) string
- func Waiting(fn func() error) error
- func Yellow(text string) string
Constants ¶
This section is empty.
Variables ¶
var DisableColors = false
DisableColors disables all colors and other ANSI sequences.
var EnvironmentOverrideColors = true
EnvironmentOverrideColors overs coloring based on `CLICOLOR` and `CLICOLOR_FORCE`. Cf. https://bixense.com/clicolors/
var ForceColors = false
ForceColors forces the use of colors and other ANSI sequences.
Functions ¶
func BrightYellow ¶ added in v0.5.1
BrightYellow returns text colored bright yellow.
func Color ¶
Color returns an aurora.Aurora instance with colors enabled or disabled depending on whether the writer supports colors.
func ColorizeJSON ¶
ColorizeJSON returns a colorized version of the input JSON, if the writer supports colors.
func Hyperlink ¶
Hyperlink wraps text in an OSC8 terminal hyperlink. Terminals that support OSC8 (iTerm2, Warp, GNOME Terminal, etc.) render the text as an underlined, clickable link. Unsupported terminals show plain text.
func InitConsole ¶ added in v0.4.1
func InitConsole()
InitConsole initializes any platform-specific aspect of the terminal. This method will run for all except Windows.
func Initialize ¶ added in v1.0.0
func Initialize(shouldDisableColors bool)
Initialize re-instantiates the Aurora instance This initialization step is necessary because the parsing of the --no-color flag is done fairly late in the application cycle.
func ProgressBar ¶ added in v1.4.0
func ProgressBar[T comparable](desc string, items []T, fn func(int, T) error) error
ProgressBar will display progress indication for the given items.
Types ¶
This section is empty.