Documentation
¶
Overview ¶
Package ui renders user-facing messages and styling for moat's CLI.
ui.Warn/Error/Info always print to stderr (with colored prefixes when it is a TTY) and are for warnings, errors, and status the user needs to see — as opposed to internal/log, which is diagnostic output hidden behind --verbose. The styling helpers (ui.Bold, ui.Green, ui.OKTag, …) degrade to plain strings when stdout is not a TTY or NO_COLOR is set.
Index ¶
- func Bold(s string) string
- func ColorEnabled() bool
- func Cyan(s string) string
- func Dim(s string) string
- func Error(msg string)
- func Errorf(format string, args ...any)
- func FailTag() string
- func Green(s string) string
- func Info(msg string)
- func InfoTag() string
- func Infof(format string, args ...any)
- func OKTag() string
- func Red(s string) string
- func Section(title string)
- func SetColorEnabled(enabled bool)
- func SetWriter(w io.Writer)
- func Warn(msg string)
- func WarnTag() string
- func Warnf(format string, args ...any)
- func Yellow(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Section ¶
func Section(title string)
Section prints a bold title with a thin underline to stdout.
func SetColorEnabled ¶
func SetColorEnabled(enabled bool)
SetColorEnabled overrides color detection (for testing).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.