Documentation
¶
Index ¶
- Constants
- Variables
- func AutoSizeColumns(headers []string, rows [][]string, padding int, flexCols ...int)
- func Debug(format string, args ...any)
- func FormatDuration(d time.Duration) string
- func Info(format string, args ...any)
- func Infof(format string, args ...any)
- func IsStdinTerminal() bool
- func IsTerminal() bool
- func PlainStatusIcon(status, state string) string
- func PlainStatusText(status, state string) string
- func PrintJSON(data any) error
- func PrintLogo()
- func PrintPlainTable(headers []string, rows [][]string, noHeader bool)
- func PrintTable(headers []string, rows [][]string)
- func RelativeTime(t time.Time) string
- func StatusIcon(status, state string) string
- func StatusText(status, state string) string
- func Success(format string, args ...any)
- func TerminalSize() (int, int)
- func TerminalWidth() int
- func Truncate(s string, maxLen int) string
- func Warn(format string, args ...any)
- func WithPager(fn func(w io.Writer))
Constants ¶
const Logo = `` /* 229-byte string literal not displayed */
Variables ¶
var ( Green = color.New(color.FgGreen).SprintFunc() Red = color.New(color.FgRed).SprintFunc() Yellow = color.New(color.FgYellow).SprintFunc() Cyan = color.New(color.FgCyan).SprintFunc() Bold = color.New(color.Bold).SprintFunc() Faint = color.New(color.Faint).SprintFunc() )
var Quiet bool
Quiet suppresses non-essential output when true
var Verbose bool
Verbose enables debug output when true
Functions ¶
func AutoSizeColumns ¶ added in v0.5.0
AutoSizeColumns truncates flexible columns in-place to fit the terminal width. Fixed columns keep their natural width; the remaining space goes to flex columns.
func FormatDuration ¶
FormatDuration formats a duration in human-readable form
func IsStdinTerminal ¶
func IsStdinTerminal() bool
IsStdinTerminal returns true if stdin is a terminal
func PlainStatusIcon ¶
PlainStatusIcon returns a plain text status icon (for --plain output)
func PlainStatusText ¶
PlainStatusText returns plain status text (for --plain output)
func PrintPlainTable ¶
PrintPlainTable prints tab-separated output for scripting (works with cut -f, awk)
func PrintTable ¶
PrintTable prints a formatted table with proper Unicode/ANSI handling
func RelativeTime ¶
RelativeTime formats a time as relative to now
func StatusIcon ¶
StatusIcon returns a colored status icon
func StatusText ¶
StatusText returns colored status text
func TerminalSize ¶
TerminalSize returns terminal width and height (defaults: 80x24)
func TerminalWidth ¶
func TerminalWidth() int
TerminalWidth returns the terminal width, or 80 as default
func Truncate ¶
Truncate truncates a string to maxLen display width, adding "..." if truncated Properly handles unicode and wide characters
Types ¶
This section is empty.