Documentation
¶
Overview ¶
Package output provides display helpers for consistent CLI output
Package output provides formatters for CLI output ¶
Package output provides shared formatting helpers for CLI output
Index ¶
- func Alert(msg string)
- func Alertf(format string, a ...interface{})
- func BoolYesNo(b bool) string
- func Bullet(text string)
- func Bulletf(format string, a ...interface{})
- func Dim(text string)
- func Dimf(format string, a ...interface{})
- func Empty(msg, suggestion string)
- func EmptyContext(resource, workspace, project, suggestion string)
- func EmptyDefault(s, defaultVal string) string
- func Error(msg string)
- func Errorf(format string, a ...interface{})
- func FormatDate(dateStr string) string
- func FormatDuration(hours float64) string
- func FormatMoney(symbol string, amount float64) string
- func FormatStatInline(label string, value interface{}) string
- func Header(title string)
- func Info(msg string)
- func Infof(format string, a ...interface{})
- func KeyValue(key, value string)
- func KeyValuef(key, format string, a ...interface{})
- func PriorityLabel(priority int) string
- func Separator()
- func Stat(label string, value interface{})
- func StatLine(stats ...string)
- func StatusIcon(status string) string
- func StripHTML(html string) string
- func SubHeader(title string)
- func Success(msg string)
- func Successf(format string, a ...interface{})
- func Truncate(s string, maxLen int) string
- func Warning(msg string)
- func Warningf(format string, a ...interface{})
- type Format
- type Formatter
- type JSONFormatter
- func (f *JSONFormatter) Print(data interface{}) error
- func (f *JSONFormatter) PrintError(msg string)
- func (f *JSONFormatter) PrintInfo(msg string)
- func (f *JSONFormatter) PrintSuccess(msg string)
- func (f *JSONFormatter) PrintTable(headers []string, rows [][]string) error
- func (f *JSONFormatter) PrintWarning(msg string)
- type QuietFormatter
- func (f *QuietFormatter) Print(data interface{}) error
- func (f *QuietFormatter) PrintError(msg string)
- func (f *QuietFormatter) PrintInfo(msg string)
- func (f *QuietFormatter) PrintSuccess(msg string)
- func (f *QuietFormatter) PrintTable(headers []string, rows [][]string) error
- func (f *QuietFormatter) PrintWarning(msg string)
- type TableFormatter
- func (f *TableFormatter) Print(data interface{}) error
- func (f *TableFormatter) PrintError(msg string)
- func (f *TableFormatter) PrintInfo(msg string)
- func (f *TableFormatter) PrintSuccess(msg string)
- func (f *TableFormatter) PrintTable(headers []string, rows [][]string) error
- func (f *TableFormatter) PrintWarning(msg string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Alertf ¶
func Alertf(format string, a ...interface{})
Alertf prints a bold yellow formatted alert message: ⚠ message
func Bulletf ¶
func Bulletf(format string, a ...interface{})
Bulletf prints a formatted bulleted list item.
func Empty ¶
func Empty(msg, suggestion string)
Empty prints a helpful empty-state message with a suggested next action.
No clients found Add one with: gitscrum clients create "Name"
func EmptyContext ¶
func EmptyContext(resource, workspace, project, suggestion string)
EmptyContext prints an empty-state message with workspace/project context. Use this for project-scoped resources like tasks, sprints, wiki pages.
No tasks found in project "my-project" (workspace: my-workspace) Create one with: gitscrum tasks create "Task title"
func EmptyDefault ¶
EmptyDefault returns the default value if the string is empty
func Errorf ¶
func Errorf(format string, a ...interface{})
Errorf prints a red formatted error message: ✗ message
func FormatDate ¶
FormatDate formats an ISO 8601 date string for display
func FormatDuration ¶
FormatDuration formats a duration in hours/minutes for display
func FormatMoney ¶
FormatMoney formats a monetary amount with currency symbol.
func FormatStatInline ¶
FormatStatInline formats a label:value pair for use in StatLine.
func Header ¶
func Header(title string)
Header prints a bold section header with a separator line.
┃ CRM Dashboard ┃ ────────────────────────────
func Infof ¶
func Infof(format string, a ...interface{})
Infof prints a cyan formatted info message: ● message
func KeyValue ¶
func KeyValue(key, value string)
KeyValue prints an aligned key-value pair.
Workspace: my-workspace
func KeyValuef ¶
func KeyValuef(key, format string, a ...interface{})
KeyValuef prints a formatted key-value pair.
func PriorityLabel ¶
PriorityLabel returns a human-readable priority label
func Stat ¶
func Stat(label string, value interface{})
Stat prints an inline stat with label and value.
Active: 42
func StatLine ¶
func StatLine(stats ...string)
StatLine prints a line of multiple stats separated by " │ "
func StatusIcon ¶
StatusIcon returns a text-based status icon for display
func SubHeader ¶
func SubHeader(title string)
SubHeader prints a section sub-header (dimmer than Header).
Summary
func Successf ¶
func Successf(format string, a ...interface{})
Successf prints a green formatted success message: ✓ message
Types ¶
type Formatter ¶
type Formatter interface {
// Print outputs data to stdout
Print(data interface{}) error
// PrintTable outputs tabular data
PrintTable(headers []string, rows [][]string) error
// PrintSuccess prints a success message
PrintSuccess(msg string)
// PrintError prints an error message
PrintError(msg string)
// PrintWarning prints a warning message
PrintWarning(msg string)
// PrintInfo prints an info message
PrintInfo(msg string)
}
Formatter interface for output formatting
func NewFormatter ¶
NewFormatter creates a formatter based on format type
type JSONFormatter ¶
JSONFormatter outputs data as JSON
func (*JSONFormatter) Print ¶
func (f *JSONFormatter) Print(data interface{}) error
func (*JSONFormatter) PrintError ¶
func (f *JSONFormatter) PrintError(msg string)
func (*JSONFormatter) PrintInfo ¶
func (f *JSONFormatter) PrintInfo(msg string)
func (*JSONFormatter) PrintSuccess ¶
func (f *JSONFormatter) PrintSuccess(msg string)
func (*JSONFormatter) PrintTable ¶
func (f *JSONFormatter) PrintTable(headers []string, rows [][]string) error
func (*JSONFormatter) PrintWarning ¶
func (f *JSONFormatter) PrintWarning(msg string)
type QuietFormatter ¶
QuietFormatter outputs minimal data (IDs only)
func (*QuietFormatter) Print ¶
func (f *QuietFormatter) Print(data interface{}) error
func (*QuietFormatter) PrintError ¶
func (f *QuietFormatter) PrintError(msg string)
func (*QuietFormatter) PrintInfo ¶
func (f *QuietFormatter) PrintInfo(msg string)
func (*QuietFormatter) PrintSuccess ¶
func (f *QuietFormatter) PrintSuccess(msg string)
func (*QuietFormatter) PrintTable ¶
func (f *QuietFormatter) PrintTable(headers []string, rows [][]string) error
func (*QuietFormatter) PrintWarning ¶
func (f *QuietFormatter) PrintWarning(msg string)
type TableFormatter ¶
TableFormatter outputs data as beautiful PTerm boxed tables
func (*TableFormatter) Print ¶
func (f *TableFormatter) Print(data interface{}) error
func (*TableFormatter) PrintError ¶
func (f *TableFormatter) PrintError(msg string)
func (*TableFormatter) PrintInfo ¶
func (f *TableFormatter) PrintInfo(msg string)
func (*TableFormatter) PrintSuccess ¶
func (f *TableFormatter) PrintSuccess(msg string)
func (*TableFormatter) PrintTable ¶
func (f *TableFormatter) PrintTable(headers []string, rows [][]string) error
func (*TableFormatter) PrintWarning ¶
func (f *TableFormatter) PrintWarning(msg string)