output

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

type Table struct {
	Headers []string
	Rows    [][]string
	Out     io.Writer
}

Table represents a simple table for output

func NewTable

func NewTable(headers ...string) *Table

NewTable creates a new table

func (*Table) AddRow

func (t *Table) AddRow(cells ...string)

AddRow adds a row to the table

func (*Table) Render

func (t *Table) Render()

Render outputs the table

type Writer

type Writer struct {
	Out    io.Writer
	Err    io.Writer
	IsaTTY bool
}

Writer handles formatted output (inspired by gh CLI's iostreams)

func DefaultWriter

func DefaultWriter() *Writer

DefaultWriter creates a writer for stdout/stderr

func (*Writer) Error

func (w *Writer) Error(format string, args ...interface{})

Error prints an error message with an X

func (*Writer) Info

func (w *Writer) Info(format string, args ...interface{})

Info prints an info message

func (*Writer) List

func (w *Writer) List(items []string)

List prints a bulleted list

func (*Writer) ListWithMarker

func (w *Writer) ListWithMarker(items []string, markerIndex int, marker string)

ListWithMarker prints a list with a custom marker for one item

func (*Writer) Print

func (w *Writer) Print(format string, args ...interface{})

Print prints a message without prefix

func (*Writer) Println

func (w *Writer) Println(format string, args ...interface{})

Println prints a message with newline

func (*Writer) Success

func (w *Writer) Success(format string, args ...interface{})

Success prints a success message with a checkmark

func (*Writer) Warning

func (w *Writer) Warning(format string, args ...interface{})

Warning prints a warning message

Jump to

Keyboard shortcuts

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