diff --git a/cmd.go b/cmd.go index 5c643420..952f549a 100644 --- a/cmd.go +++ b/cmd.go @@ -561,9 +561,9 @@ func numberMenu(pkgS []string, flags []string) (err error) { aurQ.printSearch(numpq + 1) } - fmt.Printf("\x1b[32m%s %s\x1b[0m\nNumbers: ", - "Type the numbers or ranges (e.g. 1-10) you want to install.", - "Separate each one of them with a space.") + fmt.Println(greenFg("Type the numbers or ranges (e.g. 1-10) you want to install. " + + "Separate each one of them with a space.")) + fmt.Print("Numbers: ") reader := bufio.NewReader(os.Stdin) numberBuf, overflow, err := reader.ReadLine() if err != nil || overflow { @@ -673,7 +673,8 @@ func passToMakepkg(dir string, args ...string) (err error) { if err == nil { _ = saveVCSInfo() if config.CleanAfter { - fmt.Println("\x1b[1;32m==> CleanAfter enabled. Deleting source folder.\x1b[0m") + fmt.Println(boldGreenFg(arrow + + " CleanAfter enabled. Deleting source folder.")) os.RemoveAll(dir) } } diff --git a/print.go b/print.go index e3569398..d3773a05 100644 --- a/print.go +++ b/print.go @@ -287,6 +287,14 @@ func redFg(in string) string { return in } +func greenFg(in string) string { + if alpmConf.Options&alpm.ConfColor > 0 { + return "\x1b[0;32m" + in + "\x1b[0m" + } + + return in +} + func yellowFg(in string) string { if alpmConf.Options&alpm.ConfColor > 0 { return "\x1b[0;33m" + in + "\x1b[0m" @@ -311,6 +319,14 @@ func boldYellowFg(in string) string { return in } +func boldBlueFg(in string) string { + if alpmConf.Options&alpm.ConfColor > 0 { + return "\x1b[1;34m" + in + "\x1b[0m" + } + + return in +} + func boldCyanFg(in string) string { if alpmConf.Options&alpm.ConfColor > 0 { return "\x1b[1;36m" + in + "\x1b[0m" @@ -329,7 +345,7 @@ func boldWhiteFg(in string) string { func redFgBlackBg(in string) string { if alpmConf.Options&alpm.ConfColor > 0 { - return "\x1b[31;40m" + in + "\x1b[0m" + return "\x1b[0;31;40m" + in + "\x1b[0m" } return in @@ -337,7 +353,7 @@ func redFgBlackBg(in string) string { func greenFgBlackBg(in string) string { if alpmConf.Options&alpm.ConfColor > 0 { - return "\x1b[32;40m" + in + "\x1b[0m" + return "\x1b[0;32;40m" + in + "\x1b[0m" } return in diff --git a/upgrade.go b/upgrade.go index b3c27541..c1251688 100644 --- a/upgrade.go +++ b/upgrade.go @@ -305,12 +305,13 @@ func upgradePkgs(flags []string) error { var repoNums []int var aurNums []int sort.Sort(repoUp) - fmt.Printf("\x1b[1;34;1m:: \x1b[0m\x1b[1m%d Packages to upgrade.\x1b[0m\n", len(aurUp)+len(repoUp)) + fmt.Println(boldBlueFg("::"), len(aurUp)+len(repoUp), boldWhiteFg("Packages to upgrade.")) repoUp.Print(len(aurUp) + 1) aurUp.Print(1) if !config.NoConfirm { - fmt.Print("\x1b[32mEnter packages you don't want to upgrade.\x1b[0m\nNumbers: ") + fmt.Println(greenFg("Enter packages you don't want to upgrade.")) + fmt.Print("Numbers: ") reader := bufio.NewReader(os.Stdin) numberBuf, overflow, err := reader.ReadLine()