Documentation
¶
Index ¶
- Constants
- func GetExitCode(err error) int
- type ExecutionSummary
- type Formatter
- func (f *Formatter) BlankLine()
- func (f *Formatter) Bullet(text string)
- func (f *Formatter) BulletWithDetail(main, detail string)
- func (f *Formatter) Divider()
- func (f *Formatter) Error(message string)
- func (f *Formatter) Header(text string)
- func (f *Formatter) Indent(level int, text string)
- func (f *Formatter) Info(message string)
- func (f *Formatter) Success(verb string, count int, singular, plural string)
- func (f *Formatter) SuccessSimple(message string)
- func (f *Formatter) Warning(message string)
- type Printer
- func (p *Printer) PrintDebug(message string)
- func (p *Printer) PrintDryRunSummary(plan domain.Plan)
- func (p *Printer) PrintError(message string)
- func (p *Printer) PrintInfo(message string)
- func (p *Printer) PrintSuccess(message string)
- func (p *Printer) PrintSummary(summary ExecutionSummary)
- func (p *Printer) PrintWarning(message string)
- type VerboseLogger
- func (l *VerboseLogger) Always(format string, args ...interface{})
- func (l *VerboseLogger) Debug(format string, args ...interface{})
- func (l *VerboseLogger) Info(format string, args ...interface{})
- func (l *VerboseLogger) IsQuiet() bool
- func (l *VerboseLogger) Level() int
- func (l *VerboseLogger) Summary(format string, args ...interface{})
Constants ¶
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 ¶
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 ¶
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) BulletWithDetail ¶
BulletWithDetail prints a bullet point with main text and detail. Example: "• main — detail"
func (*Formatter) Success ¶
Success formats and prints a success message with icon. Format: "✓ [verb] [count] [item]" Example: "✓ Managed 2 packages"
func (*Formatter) SuccessSimple ¶
SuccessSimple prints a simple success message. Example: "✓ Upgrade completed"
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer handles output formatting and display.
func NewPrinter ¶
NewPrinter creates a new output printer.
func (*Printer) PrintDebug ¶
PrintDebug outputs a debug message.
func (*Printer) PrintDryRunSummary ¶
PrintDryRunSummary outputs dry-run summary.
func (*Printer) PrintError ¶
PrintError outputs an error message to stderr.
func (*Printer) PrintSuccess ¶
PrintSuccess outputs a success message.
func (*Printer) PrintSummary ¶
func (p *Printer) PrintSummary(summary ExecutionSummary)
PrintSummary outputs operation summary.
func (*Printer) PrintWarning ¶
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+).