Documentation
¶
Index ¶
- func Sanitize(s string) string
- func SanitizeMultiline(s string) string
- func Truncate(s string, maxRunes int) string
- type Envelope
- type Format
- type Printer
- func (p *Printer) Print(headers []string, rows [][]string, jsonData interface{}, count int, ...) error
- func (p *Printer) PrintJSON(results interface{}, count int, nextLink string) error
- func (p *Printer) PrintPlain(headers []string, rows [][]string) error
- func (p *Printer) PrintTable(headers []string, rows [][]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Sanitize ¶
Sanitize removes control characters from a string, replacing newlines with spaces (safe for single-line table cells). Use SanitizeMultiline for free-text body output where newlines should be preserved.
func SanitizeMultiline ¶
SanitizeMultiline removes control characters but preserves newlines, suitable for multi-line body text output.
Types ¶
type Envelope ¶
type Envelope struct {
Results interface{} `json:"results"`
Count int `json:"count"`
NextLink string `json:"nextLink,omitempty"`
}
Envelope is the JSON output wrapper
type Printer ¶
type Printer struct {
Format Format
Writer io.Writer
Select string // comma-separated field names
ResultsOnly bool
}
Printer handles output formatting
func NewPrinter ¶
NewPrinter creates a printer from flags
func (*Printer) Print ¶
func (p *Printer) Print(headers []string, rows [][]string, jsonData interface{}, count int, nextLink string) error
Print dispatches to the appropriate format
func (*Printer) PrintPlain ¶
PrintPlain outputs data as TSV (no headers)
Click to show internal directories.
Click to hide internal directories.