Documentation
¶
Overview ¶
Package style provides consistent terminal output styling for gh-stack. It follows GitHub CLI color conventions and respects NO_COLOR and TTY detection.
Index ¶
- type Style
- func (s *Style) Bold(t string) string
- func (s *Style) Boldf(format string, args ...any) string
- func (s *Style) Branch(t string) string
- func (s *Style) Branchf(format string, args ...any) string
- func (s *Style) Enabled() bool
- func (s *Style) Error(t string) string
- func (s *Style) Errorf(format string, args ...any) string
- func (s *Style) FailureIcon() string
- func (s *Style) FailureMessage(msg string) string
- func (s *Style) Merged(t string) string
- func (s *Style) Mergedf(format string, args ...any) string
- func (s *Style) Muted(t string) string
- func (s *Style) Mutedf(format string, args ...any) string
- func (s *Style) Success(t string) string
- func (s *Style) SuccessIcon() string
- func (s *Style) SuccessMessage(msg string) string
- func (s *Style) Successf(format string, args ...any) string
- func (s *Style) Warning(t string) string
- func (s *Style) WarningIcon() string
- func (s *Style) WarningMessage(msg string) string
- func (s *Style) Warningf(format string, args ...any) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Style ¶
type Style struct {
// contains filtered or unexported fields
}
Style provides methods for styling terminal output. All methods return plain text when colors are disabled.
func New ¶
func New() *Style
New creates a new Style instance. Colors are automatically enabled/disabled based on terminal capabilities.
func NewWithColor ¶
NewWithColor creates a Style with explicit color setting. Useful for testing or forcing color on/off.
func (*Style) FailureIcon ¶
FailureIcon returns the failure icon (✗) in red.
func (*Style) FailureMessage ¶
FailureMessage formats a complete failure message with icon. Example: "✗ Operation failed"
func (*Style) SuccessIcon ¶
SuccessIcon returns the success icon (✓) in green.
func (*Style) SuccessMessage ¶
SuccessMessage formats a complete success message with icon. Example: "✓ Operation complete"
func (*Style) WarningIcon ¶
WarningIcon returns the warning icon (!) in yellow.
func (*Style) WarningMessage ¶
WarningMessage formats a complete warning message with icon. Example: "! Something might be wrong"