Documentation
¶
Overview ¶
Package output provides a small result writer shared by all tg commands.
Commands produce a typed result and hand it to a Printer. In JSON mode the result is wrapped in a stable envelope ({"schema":N,"data":...}) so agents can parse it; in text mode a human-friendly rendering is used. All machine output goes to stdout; logs and progress must go to stderr.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Format ¶
type Format string
Format is the output format selected by the global --output flag.
func ParseFormat ¶
ParseFormat validates and returns the format for s.
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer writes command results in the configured format.
func (*Printer) SetAccount ¶
SetAccount sets the account label included with each emitted result. Empty disables it (single-account mode).
type TextMarshaler ¶
TextMarshaler is implemented by results that render a custom text form. Results without it fall back to fmt's default formatting in text mode.