@@ -11,6 +11,7 @@ import (
1111 "os/exec"
1212 "strings"
1313
14+ "github.com/fatih/color"
1415 "github.com/lmittmann/tint"
1516 "github.com/mattn/go-colorable"
1617 "github.com/spf13/cobra"
@@ -33,7 +34,13 @@ const (
3334 YAMLOutputFormat = "yaml"
3435)
3536
36- var errAborted = errors .New ("operation aborted" )
37+ var (
38+ errAborted = errors .New ("operation aborted" )
39+
40+ WhiteBold = color .New (color .FgHiWhite , color .Bold ).SprintFunc ()
41+ RedBold = color .New (color .FgHiRed , color .Bold ).SprintFunc ()
42+ YellowBold = color .New (color .FgHiYellow , color .Bold ).SprintFunc ()
43+ )
3744
3845type Printer struct {
3946 Cmd * cobra.Command
@@ -106,13 +113,13 @@ func (p *Printer) Warn(msg string, args ...any) {
106113 return
107114 }
108115 warning := fmt .Sprintf (msg , args ... )
109- p .Cmd .PrintErrf ("Warning: %s" , warning )
116+ p .Cmd .PrintErrf ("%s %s" , YellowBold ( "Warning:" ) , warning )
110117}
111118
112119// Print an Error level output to the defined Err output (falling back to Stderr if not set).
113120func (p * Printer ) Error (msg string , args ... any ) {
114121 err := fmt .Sprintf (msg , args ... )
115- p .Cmd .PrintErrln (p .Cmd .ErrPrefix (), err )
122+ p .Cmd .PrintErrln (RedBold ( p .Cmd .ErrPrefix () ), err )
116123}
117124
118125// Prompts the user for confirmation.
0 commit comments