Documentation
¶
Overview ¶
Package ui provides a structured, tag-prefixed printer for user-facing stderr output.
All user-facing narrative output (progress, status, warnings) should be written via Printer so it is consistently tagged and goes to stderr, keeping stdout clean for machine-consumed payloads (__TREEPAD_CD__, JSON, config dumps).
Error contract: any non-zero exit must emit exactly one [ERR] line on stderr describing the user-actionable problem. Individual commands return plain errors; the [ERR] tag is applied at the top-level boundary in cmd/tp/main.go.
Index ¶
- type Printer
- func (p *Printer) Debug(format string, a ...any)
- func (p *Printer) Err(format string, a ...any)
- func (p *Printer) Info(format string, a ...any)
- func (p *Printer) OK(format string, a ...any)
- func (p *Printer) Prompt(format string, a ...any)
- func (p *Printer) Step(format string, a ...any)
- func (p *Printer) Warn(format string, a ...any)
- func (p *Printer) Writer() io.Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer writes fixed-width tagged lines to an io.Writer. A nil Printer is safe to use; all calls are no-ops.
func New ¶
New returns a Printer that writes to w. Debug output is enabled when TREEPAD_DEBUG is set to a non-empty value.