Documentation
¶
Overview ¶
Package output holds the terminal helpers the commands print with: the color palette, status and package formatting, and terminal detection that turns color off when stdout is not a terminal or NO_COLOR is set.
Index ¶
- Variables
- func Box(title, content string)
- func ForceColor()
- func FormatPackage(category, pkg string) string
- func FormatStatus(status string) string
- func IsTerminal() bool
- func NoColor()
- func PrintError(format string, args ...interface{})
- func PrintInfo(format string, args ...interface{})
- func PrintSuccess(format string, args ...interface{})
- func PrintWarning(format string, args ...interface{})
- func Printf(c *color.Color, format string, args ...interface{})
- func Println(c *color.Color, a ...interface{})
- func Sprint(c *color.Color, a ...interface{}) string
- func Sprintf(c *color.Color, format string, args ...interface{}) string
- func StatusColor(status string) *color.Color
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Status colors Added = color.New(color.FgGreen) Modified = color.New(color.FgYellow) Deleted = color.New(color.FgRed) Renamed = color.New(color.FgCyan) Untracked = color.New(color.FgMagenta) // Message colors Success = color.New(color.FgGreen) Warning = color.New(color.FgYellow) Error = color.New(color.FgRed) Info = color.New(color.FgCyan) Dim = color.New(color.Faint) // Structural colors Header = color.New(color.FgWhite, color.Bold) Package = color.New(color.FgBlue, color.Bold) )
Functions ¶
func FormatPackage ¶
FormatPackage formats a package name with color
func FormatStatus ¶
FormatStatus formats a status string with appropriate color
func PrintError ¶
func PrintError(format string, args ...interface{})
PrintError prints an error message
func PrintInfo ¶
func PrintInfo(format string, args ...interface{})
PrintInfo prints an info message
func PrintSuccess ¶
func PrintSuccess(format string, args ...interface{})
PrintSuccess prints a success message
func PrintWarning ¶
func PrintWarning(format string, args ...interface{})
PrintWarning prints a warning message
func StatusColor ¶
StatusColor returns the appropriate color for a git status
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.