output

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeForTerminal

func SanitizeForTerminal(text string) string

SanitizeForTerminal strips control characters and dangerous Unicode markers before untrusted text is printed to a terminal or log sink.

func Write

func Write(w io.Writer, format Format, payload any) error

func WriteCommandPayload

func WriteCommandPayload(cmd *cobra.Command, payload any, fallback Format) error

func WriteJSON

func WriteJSON(w io.Writer, payload any) error

WriteJSON marshals payload as indented JSON and writes it to w.

Types

type Format

type Format string
const (
	FormatJSON  Format = "json"
	FormatTable Format = "table"
	FormatRaw   Format = "raw"
)

func ResolveFormat

func ResolveFormat(cmd *cobra.Command, fallback Format) Format

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL