tableprinter

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 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 TablePrinter

type TablePrinter struct {
	// contains filtered or unexported fields
}

TablePrinter provides bc4-specific table functionality wrapping the core tableprinter

func New

func New(writer io.Writer) *TablePrinter

New creates a new bc4 table printer with automatic TTY detection

func NewWithOptions

func NewWithOptions(writer io.Writer, isTTY bool, maxWidth int) *TablePrinter

NewWithOptions creates a table printer with specific options

func (*TablePrinter) AddColorField

func (t *TablePrinter) AddColorField(text, state string)

AddColorField adds a field with color based on state

func (*TablePrinter) AddField

func (t *TablePrinter) AddField(text string, colorFunc ...func(string) string)

AddField adds a field to the current row

func (*TablePrinter) AddHeader

func (t *TablePrinter) AddHeader(columns ...string)

AddHeader adds headers to the table, following GitHub CLI's pattern

func (*TablePrinter) AddIDField

func (t *TablePrinter) AddIDField(id string, state string)

AddIDField adds an ID field with appropriate formatting

func (*TablePrinter) AddProjectField

func (t *TablePrinter) AddProjectField(name, state string)

AddProjectField adds a project name field

func (*TablePrinter) AddStatusField

func (t *TablePrinter) AddStatusField(completed bool)

AddStatusField adds a status symbol field (like GitHub CLI's check marks)

func (*TablePrinter) AddTimeField

func (t *TablePrinter) AddTimeField(now, timestamp time.Time)

AddTimeField adds a time field with GitHub CLI-style formatting

func (*TablePrinter) AddTodoField

func (t *TablePrinter) AddTodoField(title string, completed bool)

AddTodoField adds a todo item field with status indication

func (*TablePrinter) EndRow

func (t *TablePrinter) EndRow()

EndRow completes the current row

func (*TablePrinter) GetColorScheme

func (t *TablePrinter) GetColorScheme() *tableprinter.ColorScheme

GetColorScheme returns the color scheme for direct access

func (*TablePrinter) IsTTY

func (t *TablePrinter) IsTTY() bool

IsTTY returns whether the output is a terminal

func (*TablePrinter) Render

func (t *TablePrinter) Render() error

Render outputs the complete table

Jump to

Keyboard shortcuts

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