mirror of
https://github.com/Jguer/yay
synced 2024-10-31 04:12:51 +00:00
Ports more text to new colour format.
This commit is contained in:
parent
5286f3858c
commit
f466fc74f5
3 changed files with 26 additions and 8 deletions
9
cmd.go
9
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)
|
||||
}
|
||||
}
|
||||
|
|
20
print.go
20
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
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue