Skip to content

Commit

Permalink
chore(prints): Make some adjustments to color configurations (#91)
Browse files Browse the repository at this point in the history
Signed-off-by: Flc゛ <[email protected]>
  • Loading branch information
flc1125 authored Feb 2, 2024
1 parent 8fad89d commit ea462d1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions prints/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import (

var (
line = color.New()
info = color.New(color.FgGreen)
comment = color.New(color.FgYellow)
info = color.New(color.FgCyan)
comment = color.New(color.FgWhite)
errs = color.New(color.FgRed)
warn = color.New(color.FgHiYellow)
alert = comment
warn = color.New(color.FgYellow)
alert = color.New(color.FgYellow, color.ReverseVideo)
success = color.New(color.FgGreen)
)

func Line(a ...interface{}) (int, error) {
Expand Down Expand Up @@ -74,3 +75,11 @@ func Alert(a ...interface{}) (int, error) {
func Alertf(format string, a ...interface{}) (int, error) {
return alert.Printf(format, a...)
}

func Success(a ...interface{}) (int, error) {
return success.Println(a...)
}

func Successf(format string, a ...interface{}) (int, error) {
return success.Printf(format, a...)
}
Binary file modified prints/output.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion prints/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (p *Prompt) Ask() (string, error) {
return "", err
}
if p.defaultAnswer != "" {
if _, err := Alertf("[%s] ", p.defaultAnswer); err != nil {
if _, err := Warnf("[%s] ", p.defaultAnswer); err != nil {
return "", err
}
}
Expand Down

0 comments on commit ea462d1

Please sign in to comment.