Files
gastown/internal/style/style.go
Steve Yegge 5e9ca4c618 Standardize warning output to use style.PrintWarning (gt-g6kor)
- Add PrintWarning helper in internal/style/style.go
- Update 35 warning message outputs across 16 files to use consistent format
- All warnings now display as "⚠ Warning: <message>" in yellow/bold

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:38:04 -08:00

57 lines
1.4 KiB
Go

// Package style provides consistent terminal styling using Lipgloss.
package style
import (
"fmt"
"github.com/charmbracelet/lipgloss"
)
var (
// Success style for positive outcomes
Success = lipgloss.NewStyle().
Foreground(lipgloss.Color("10")). // Green
Bold(true)
// Warning style for cautionary messages
Warning = lipgloss.NewStyle().
Foreground(lipgloss.Color("11")). // Yellow
Bold(true)
// Error style for failures
Error = lipgloss.NewStyle().
Foreground(lipgloss.Color("9")). // Red
Bold(true)
// Info style for informational messages
Info = lipgloss.NewStyle().
Foreground(lipgloss.Color("12")) // Blue
// Dim style for secondary information
Dim = lipgloss.NewStyle().
Foreground(lipgloss.Color("8")) // Gray
// Bold style for emphasis
Bold = lipgloss.NewStyle().
Bold(true)
// SuccessPrefix is the checkmark prefix for success messages
SuccessPrefix = Success.Render("✓")
// WarningPrefix is the warning prefix
WarningPrefix = Warning.Render("⚠")
// ErrorPrefix is the error prefix
ErrorPrefix = Error.Render("✗")
// ArrowPrefix for action indicators
ArrowPrefix = Info.Render("→")
)
// PrintWarning prints a warning message with consistent formatting.
// The format and args work like fmt.Printf.
func PrintWarning(format string, args ...interface{}) {
msg := fmt.Sprintf(format, args...)
fmt.Printf("%s %s\n", Warning.Render("⚠ Warning:"), msg)
}