Documentation ¶
Overview ¶
Package o defines functions for human-readable log messages. The package matches Homebrew's messaging functions.
Index ¶
- Constants
- Variables
- func Color() bool
- func Debug(msg string)
- func Die(msg string)
- func EmojiPrefixed(msg string) string
- func H1(msg string)
- func Hai(msg string)
- func InstallBadge() string
- func LogStyles() *log.Styles
- func NoEmoji() bool
- func Noe(msg string)
- func Noop(_ string)
- func Poo(msg string)
- func PrettyInstalled(formula string) string
- func PrettyOutdated(formula string) string
- func PrettyUninstalled(formula string) string
- func SetInstallBadge(value string)
- func SetNoEmoji(value bool)
- func StyleBlue(s string) string
- func StyleBold(s string) string
- func StyleEach(style termenv.Style, s []string) []string
- func StyleFaint(s string) string
- func StyleGreen(s string) string
- func StyleRed(s string) string
- func StyleUnderline(s string) string
- func StyleYellow(s string) string
Constants ¶
const ( Arrow = "==>" // arrow used to prefix log message headers Check = "✔" // Check mark used to indicate success Warning = "⚠" // Exclamation sign used to indicate warning X = "✘" // "X" mark used to indicate failure )
Variables ¶
var ( StyleSuccess = StyleGreen // semantic name for the green style StyleWarning = StyleYellow // semantic name for the yellow style StyleError = StyleRed // semantic name for the red style )
Semantic aliases for defined styles.
var ( // Returns width of terminal clamped between 80 and 120. // With of 80 is used for non-TTY terminals. Width = min(utils.TerminalWidth(80), 120) )
Defined styles.
Functions ¶
func Debug ¶
func Debug(msg string)
Debug prints a debug message, prefixed with a magenta arrow.
It is an implementation of Homebrew's Formula.odebug function.
func Die ¶
func Die(msg string)
Die prints an error, prefixed with "Error:".
stderr
It is an implementation of Homebrew's Formula.odie function, but does not exit like Formulae.odie.
func EmojiPrefixed ¶
EmojiPrefixed returns msg prefixed with the install badge Obeys the NoEmoji and InstallBadge settings.
func H1 ¶
func H1(msg string)
H1 prints a message, prefixed with a green arrow.
It is an implementation of Homebrew's Formula.oh1 function.
func Hai ¶
func Hai(msg string)
Hai prints a message, prefixed with a blue arrow.
It is an implementation of Homebrew's Formula.ohai function.
func Noe ¶
func Noe(msg string)
Noe prints an error, prefixed with "Error:".
stderr
It is an implementation of Homebrew's Formula.onoe function.
func Poo ¶
func Poo(msg string)
Poo prints a warning, prefixed with "Warning:".
stderr
It is an implementation of Homebrew's Formula.opoo function.
func PrettyInstalled ¶
PrettyInstalled formats an installed formula's name.
func PrettyOutdated ¶
PrettyOutdated formats an outdated formula's name.
func PrettyUninstalled ¶
PrettyUninstalled formats an uninstalled formula's name.
func SetInstallBadge ¶
func SetInstallBadge(value string)
SetInstallBadge sets the install badge setting.
Types ¶
This section is empty.