Documentation
¶
Index ¶
- Variables
- func Error(args interface{})deprecated
- func Errorf(format string, args ...interface{})deprecated
- func Fatal(args interface{})deprecated
- func Fatalf(format string, args ...interface{})deprecated
- func Info(text string)
- func Infof(format string, a ...interface{})
- func MakeGradientRamp(length int) []lipgloss.Color
- func MakeGradientText(baseStyle lipgloss.Style, str string) string
- func NewAnim(cyclingCharsSize uint, label string, r *lipgloss.Renderer, s Styles) anim
- func NewPrompt(prefix string, enableColor bool, completer prompt.Completer, exec func(string)) *prompt.Prompt
- func PrintConfirmation(action, content string)
- func Render(format string, args ...interface{})
- func RenderAppName(appName string, suffix string, args ...interface{})
- func RenderError(err error, reason string, args ...interface{})
- func RenderStep(format string, args ...interface{})
- func RenderSuccess(format string, args ...interface{})
- func Success(text string)
- func Successf(format string, args ...interface{})
- func WaitForUserConfirm(defaultVal confirmation.Value, format string, args ...interface{}) bool
- func Warn(text string)
- func Warnf(format string, args ...interface{})
- type Styles
Constants ¶
This section is empty.
Variables ¶
var No = confirmation.No
var StderrRenderer = sync.OnceValue(func() *lipgloss.Renderer { return lipgloss.NewRenderer(os.Stderr, termenv.WithColorCache(true)) })
var StderrStyles = sync.OnceValue(func() Styles { return MakeStyles(StderrRenderer()) })
var StdoutRenderer = sync.OnceValue(func() *lipgloss.Renderer { return lipgloss.DefaultRenderer() })
var StdoutStyles = sync.OnceValue(func() Styles { return MakeStyles(StdoutRenderer()) })
var Yes = confirmation.Yes
Functions ¶
func Error
deprecated
func Error(args interface{})
Deprecated: uses console.StderrRenderer() Error handles and displays an error message. It formats the error message using the provided arguments.
func Fatal
deprecated
func Fatal(args interface{})
Deprecated: uses console.StderrRenderer() Fatal handles and displays a fatal error message. It then exits the program with a status code of 1.
func Infof ¶
func Infof(format string, a ...interface{})
Infof formats and prints an informational message with the defined style.
func MakeGradientRamp ¶
func PrintConfirmation ¶
func PrintConfirmation(action, content string)
func RenderAppName ¶
func RenderError ¶
func RenderStep ¶
func RenderStep(format string, args ...interface{})
RenderStep renders commit process step messages with a prefix
func RenderSuccess ¶
func RenderSuccess(format string, args ...interface{})
RenderSuccess renders successful commit messages
func Success ¶
func Success(text string)
Success prints a bold green success message with top padding. The message is styled with a green foreground color (terminal color 2) and bold text. Example usage: console.Success("Operation completed successfully")
func Successf ¶
func Successf(format string, args ...interface{})
Successf prints a formatted bold green success message with top padding. Uses fmt.Sprintf syntax for formatting and applies the same styling as Success. Example usage: console.Successf("Successfully processed %d items", count)
func WaitForUserConfirm ¶
func WaitForUserConfirm(defaultVal confirmation.Value, format string, args ...interface{}) bool
Types ¶
type Styles ¶
type Styles struct { AppName, CliArgs, Comment, CyclingChars, ErrorHeader, ErrorDetails, ErrPadding, Flag, FlagComma, FlagDesc, InlineCode, Link, Pipe, Quote, ConversationList, SHA1, Timeago, CommitStep, CommitSuccess, DiffHeader, DiffFileHeader, DiffHunkHeader, DiffAdded, DiffRemoved, DiffContext lipgloss.Style }