output

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitSuccess          = 0
	ExitGeneralError     = 1
	ExitInvalidArguments = 2
	ExitConflict         = 3
	ExitPermissionDenied = 4
	ExitPackageNotFound  = 5
)

Exit codes for different error types.

Variables

This section is empty.

Functions

func GetExitCode

func GetExitCode(err error) int

GetExitCode returns the appropriate exit code for an error.

Types

type ExecutionSummary

type ExecutionSummary struct {
	PackageNames []string
	LinksCreated int
	DirsCreated  int
	Duration     time.Duration
	DryRun       bool
}

ExecutionSummary contains execution result statistics.

type Formatter

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

Formatter provides consistent formatting for CLI output.

func NewFormatter

func NewFormatter(w io.Writer, colorEnabled bool) *Formatter

NewFormatter creates a formatter with the given colorization setting.

func (*Formatter) BlankLine

func (f *Formatter) BlankLine()

BlankLine prints a single blank line for consistent spacing.

func (*Formatter) Bullet

func (f *Formatter) Bullet(text string)

Bullet prints a bullet point item.

func (*Formatter) BulletWithDetail

func (f *Formatter) BulletWithDetail(main, detail string)

BulletWithDetail prints a bullet point with main text and detail. Example: "• main — detail"

func (*Formatter) Divider

func (f *Formatter) Divider()

Divider prints a visual divider line.

func (*Formatter) Error

func (f *Formatter) Error(message string)

Error formats and prints an error message with icon.

func (*Formatter) Header

func (f *Formatter) Header(text string)

Header prints a section header.

func (*Formatter) Indent

func (f *Formatter) Indent(level int, text string)

Indent prints text with 2-space indentation.

func (*Formatter) Info

func (f *Formatter) Info(message string)

Info formats and prints an info message with icon.

func (*Formatter) Success

func (f *Formatter) Success(verb string, count int, singular, plural string)

Success formats and prints a success message with icon. Format: "✓ [verb] [count] [item]" Example: "✓ Managed 2 packages"

func (*Formatter) SuccessSimple

func (f *Formatter) SuccessSimple(message string)

SuccessSimple prints a simple success message. Example: "✓ Upgrade completed"

func (*Formatter) Warning

func (f *Formatter) Warning(message string)

Warning formats and prints a warning message with icon.

type Printer

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

Printer handles output formatting and display.

func NewPrinter

func NewPrinter(colorEnabled bool, verbose int, quiet bool) *Printer

NewPrinter creates a new output printer.

func (*Printer) PrintDebug

func (p *Printer) PrintDebug(message string)

PrintDebug outputs a debug message.

func (*Printer) PrintDryRunSummary

func (p *Printer) PrintDryRunSummary(plan domain.Plan)

PrintDryRunSummary outputs dry-run summary.

func (*Printer) PrintError

func (p *Printer) PrintError(message string)

PrintError outputs an error message to stderr.

func (*Printer) PrintInfo

func (p *Printer) PrintInfo(message string)

PrintInfo outputs an informational message.

func (*Printer) PrintSuccess

func (p *Printer) PrintSuccess(message string)

PrintSuccess outputs a success message.

func (*Printer) PrintSummary

func (p *Printer) PrintSummary(summary ExecutionSummary)

PrintSummary outputs operation summary.

func (*Printer) PrintWarning

func (p *Printer) PrintWarning(message string)

PrintWarning outputs a warning message.

type VerboseLogger

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

VerboseLogger provides verbosity-aware logging.

func NewVerboseLogger

func NewVerboseLogger(level int, colorEnabled bool, quiet bool) *VerboseLogger

NewVerboseLogger creates a new verbose logger.

func (*VerboseLogger) Always

func (l *VerboseLogger) Always(format string, args ...interface{})

Always logs messages regardless of verbosity (except quiet mode).

func (*VerboseLogger) Debug

func (l *VerboseLogger) Debug(format string, args ...interface{})

Debug logs debug information (level 3+).

func (*VerboseLogger) Info

func (l *VerboseLogger) Info(format string, args ...interface{})

Info logs informational messages (level 2+).

func (*VerboseLogger) IsQuiet

func (l *VerboseLogger) IsQuiet() bool

IsQuiet returns whether quiet mode is enabled.

func (*VerboseLogger) Level

func (l *VerboseLogger) Level() int

Level returns the current verbosity level.

func (*VerboseLogger) Summary

func (l *VerboseLogger) Summary(format string, args ...interface{})

Summary logs summary information (level 1+).

Jump to

Keyboard shortcuts

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