cli

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Set via ldflags at build time
	Version   = "dev"
	Commit    = "unknown"
	BuildDate = "unknown"
)

Functions

func Config

func Config() *config.Config

Config returns the loaded configuration.

func Execute

func Execute()

Execute runs the root command.

func FormatDuration

func FormatDuration(seconds int) string

FormatDuration formats a duration in seconds as mm:ss or hh:mm:ss.

func FormatProgress

func FormatProgress(current, total int, width int) string

FormatProgress formats a progress bar.

func JSONOutput

func JSONOutput() bool

JSONOutput returns true if JSON output is requested.

func Minimal

func Minimal(value string)

Minimal prints minimal output (just the essential value).

func MinimalF

func MinimalF(format string, args ...interface{})

MinimalF prints minimal formatted output.

func Normal

func Normal(label, value string)

Normal prints normal output with a label.

func NormalF

func NormalF(format string, args ...interface{})

NormalF prints normal formatted output.

func SetOutputMode

func SetOutputMode(mode OutputMode)

SetOutputMode sets the global output mode.

func StatusIcon

func StatusIcon(active bool) string

StatusIcon returns an icon for the given boolean status.

func TruncateString

func TruncateString(s string, maxLen int) string

TruncateString truncates a string to maxLen, adding "..." if truncated.

func Verbose

func Verbose() bool

Verbose returns true if verbose output is requested.

Types

type OutputMode

type OutputMode int

OutputMode represents the output format.

const (
	OutputNormal OutputMode = iota
	OutputMinimal
	OutputTable
	OutputJSON
)

func GetOutputMode

func GetOutputMode() OutputMode

GetOutputMode returns the current output mode.

type Table

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

Table provides a simple table formatter.

func NewTable

func NewTable(headers ...string) *Table

NewTable creates a new table with the given headers.

func NewTableWriter

func NewTableWriter(out io.Writer, headers ...string) *Table

NewTableWriter creates a table writing to a specific writer.

func (*Table) Flush

func (t *Table) Flush()

Flush writes the table output.

func (*Table) Row

func (t *Table) Row(values ...string)

Row adds a row to the table.

Jump to

Keyboard shortcuts

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