ui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: GPL-2.0, GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package ui provides user interface utilities and logging handlers.

Index

Constants

This section is empty.

Variables

View Source
var (
	// CommandStyle is the style for the main command executable.
	CommandStyle = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("57")) // Purple
	// FlagStyle is the style for command-line flags.
	FlagStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("39")) // Cyan
	// ValueStyle is the style for general argument values.
	ValueStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("220")) // Gold/Yellow
	// PathStyle is the style for file paths.
	PathStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("208")) // Orange (Distinct!)
	// ErrorStyle is the style for error messages.
	ErrorStyle = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("196")) // Red
	// KeyStyle is the style for configuration keys.
	KeyStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("244")) // Light Gray
	// StringValStyle is the style for configuration string values.
	StringValStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("35")) // Green
	// DryRunStyle is the style for the dry run indicator.
	DryRunStyle = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("202")) // Orange/Red
)

Styles for various CLI elements.

Functions

This section is empty.

Types

type PrettyHandler

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

PrettyHandler is a slog.Handler that prints human-readable output.

func NewPrettyHandler

func NewPrettyHandler(minLevel slog.Level) *PrettyHandler

NewPrettyHandler creates a new PrettyHandler.

func (*PrettyHandler) Enabled

func (h *PrettyHandler) Enabled(_ context.Context, level slog.Level) bool

Enabled reports whether the handler handles records at the given level.

func (*PrettyHandler) Handle

func (h *PrettyHandler) Handle(_ context.Context, r slog.Record) error

Handle handles the Record.

func (*PrettyHandler) WithAttrs

func (h *PrettyHandler) WithAttrs(attrs []slog.Attr) slog.Handler

WithAttrs returns a new Handler whose attributes consist of both the receiver's attributes and the arguments.

func (*PrettyHandler) WithGroup

func (h *PrettyHandler) WithGroup(name string) slog.Handler

WithGroup returns a new Handler with the given group name appended to the receiver's existing groups.

Jump to

Keyboard shortcuts

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