2017-08-02 19:24:03 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2018-02-19 18:36:33 +01:00
|
|
|
"os"
|
2018-01-26 02:18:49 +01:00
|
|
|
"strconv"
|
2018-01-07 18:36:31 +01:00
|
|
|
"strings"
|
2017-08-02 19:24:03 +02:00
|
|
|
|
2018-01-26 02:18:49 +01:00
|
|
|
alpm "github.com/jguer/go-alpm"
|
2017-08-02 19:24:03 +02:00
|
|
|
rpc "github.com/mikkeloscar/aur"
|
|
|
|
)
|
|
|
|
|
2018-01-26 02:18:49 +01:00
|
|
|
const arrow = "==>"
|
|
|
|
|
2017-08-02 19:24:03 +02:00
|
|
|
// Human returns results in Human readable format.
|
|
|
|
func human(size int64) string {
|
|
|
|
floatsize := float32(size)
|
|
|
|
units := [...]string{"", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi", "Yi"}
|
|
|
|
for _, unit := range units {
|
|
|
|
if floatsize < 1024 {
|
|
|
|
return fmt.Sprintf("%.1f %sB", floatsize, unit)
|
|
|
|
}
|
|
|
|
floatsize /= 1024
|
|
|
|
}
|
|
|
|
return fmt.Sprintf("%d%s", size, "B")
|
|
|
|
}
|
|
|
|
|
|
|
|
// PrintSearch handles printing search results in a given format
|
|
|
|
func (q aurQuery) printSearch(start int) {
|
2017-10-18 04:38:19 +02:00
|
|
|
localDb, _ := alpmHandle.LocalDb()
|
2017-08-02 19:24:03 +02:00
|
|
|
|
|
|
|
for i, res := range q {
|
|
|
|
var toprint string
|
2017-08-04 11:26:53 +02:00
|
|
|
if config.SearchMode == NumberMenu {
|
|
|
|
if config.SortMode == BottomUp {
|
2018-01-26 02:18:49 +01:00
|
|
|
toprint += yellowFg(strconv.Itoa(len(q)+start-i-1) + " ")
|
2017-08-02 19:24:03 +02:00
|
|
|
} else {
|
2018-01-26 02:18:49 +01:00
|
|
|
toprint += yellowFg(strconv.Itoa(start+i) + " ")
|
2017-08-02 19:24:03 +02:00
|
|
|
}
|
2017-08-04 11:26:53 +02:00
|
|
|
} else if config.SearchMode == Minimal {
|
2017-08-02 19:24:03 +02:00
|
|
|
fmt.Println(res.Name)
|
|
|
|
continue
|
|
|
|
}
|
2018-01-26 02:18:49 +01:00
|
|
|
toprint += boldWhiteFg("aur/") + boldYellowFg(res.Name) +
|
|
|
|
" " + boldCyanFg(res.Version) +
|
|
|
|
" (" + strconv.Itoa(res.NumVotes) + ") "
|
|
|
|
|
2017-08-02 19:24:03 +02:00
|
|
|
if res.Maintainer == "" {
|
2018-01-26 02:18:49 +01:00
|
|
|
toprint += redFgBlackBg("(Orphaned)") + " "
|
2017-08-02 19:24:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if res.OutOfDate != 0 {
|
2018-01-26 02:18:49 +01:00
|
|
|
toprint += redFgBlackBg("(Out-of-date)") + " "
|
2017-08-02 19:24:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if _, err := localDb.PkgByName(res.Name); err == nil {
|
2018-01-26 02:18:49 +01:00
|
|
|
toprint += greenFgBlackBg("Installed")
|
2017-08-02 19:24:03 +02:00
|
|
|
}
|
|
|
|
toprint += "\n " + res.Description
|
|
|
|
fmt.Println(toprint)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//PrintSearch receives a RepoSearch type and outputs pretty text.
|
|
|
|
func (s repoQuery) printSearch() {
|
|
|
|
for i, res := range s {
|
|
|
|
var toprint string
|
|
|
|
if config.SearchMode == NumberMenu {
|
|
|
|
if config.SortMode == BottomUp {
|
2018-01-26 02:18:49 +01:00
|
|
|
toprint += yellowFg(strconv.Itoa(len(s)-i) + " ")
|
2017-08-02 19:24:03 +02:00
|
|
|
} else {
|
2018-01-26 02:18:49 +01:00
|
|
|
toprint += yellowFg(strconv.Itoa(i+1) + " ")
|
2017-08-02 19:24:03 +02:00
|
|
|
}
|
|
|
|
} else if config.SearchMode == Minimal {
|
|
|
|
fmt.Println(res.Name())
|
|
|
|
continue
|
|
|
|
}
|
2018-01-26 02:18:49 +01:00
|
|
|
toprint += boldWhiteFg(res.DB().Name()+"/") + boldYellowFg(res.Name()) +
|
|
|
|
" " + boldCyanFg(res.Version()) + " "
|
2017-08-02 19:24:03 +02:00
|
|
|
|
|
|
|
if len(res.Groups().Slice()) != 0 {
|
|
|
|
toprint += fmt.Sprint(res.Groups().Slice(), " ")
|
|
|
|
}
|
|
|
|
|
2017-10-18 04:38:19 +02:00
|
|
|
localDb, err := alpmHandle.LocalDb()
|
2017-08-02 19:24:03 +02:00
|
|
|
if err == nil {
|
|
|
|
if _, err = localDb.PkgByName(res.Name()); err == nil {
|
2018-01-26 02:18:49 +01:00
|
|
|
toprint += greenFgBlackBg("Installed")
|
2017-08-02 19:24:03 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
toprint += "\n " + res.Description()
|
|
|
|
fmt.Println(toprint)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-20 02:23:16 +01:00
|
|
|
func formatPkgbase(pkg *rpc.Pkg, bases map[string][]*rpc.Pkg) string {
|
|
|
|
str := pkg.PackageBase
|
|
|
|
if len(bases[pkg.PackageBase]) > 1 || pkg.PackageBase != pkg.Name {
|
|
|
|
str2 := " ("
|
|
|
|
for _, split := range bases[pkg.PackageBase] {
|
|
|
|
str2 += split.Name + " "
|
|
|
|
}
|
|
|
|
str2 = str2[:len(str2)-1] + ")"
|
|
|
|
|
|
|
|
str += str2
|
|
|
|
}
|
|
|
|
|
|
|
|
return str
|
|
|
|
}
|
|
|
|
|
2018-02-05 21:05:58 +01:00
|
|
|
// printDownloadsFromRepo prints repository packages to be downloaded
|
2018-02-15 22:23:34 +01:00
|
|
|
func printDepCatagories(dc *depCatagories) {
|
|
|
|
repo := ""
|
|
|
|
repoMake := ""
|
|
|
|
aur := ""
|
|
|
|
aurMake := ""
|
|
|
|
|
|
|
|
repoLen := 0
|
|
|
|
repoMakeLen := 0
|
|
|
|
aurLen := 0
|
|
|
|
aurMakeLen := 0
|
|
|
|
|
|
|
|
for _, pkg := range dc.Repo {
|
|
|
|
if dc.MakeOnly.get(pkg.Name()) {
|
|
|
|
repoMake += " " + pkg.Name()
|
|
|
|
repoMakeLen++
|
|
|
|
} else {
|
|
|
|
repo += " " + pkg.Name()
|
|
|
|
repoLen++
|
|
|
|
}
|
2018-02-05 21:05:58 +01:00
|
|
|
}
|
2018-02-15 22:23:34 +01:00
|
|
|
|
|
|
|
for _, pkg := range dc.Aur {
|
|
|
|
pkgStr := " " + pkg.PackageBase
|
|
|
|
pkgStrMake := pkgStr
|
|
|
|
|
|
|
|
push := false
|
|
|
|
pushMake := false
|
|
|
|
|
|
|
|
if len(dc.Bases[pkg.PackageBase]) > 1 || pkg.PackageBase != pkg.Name {
|
|
|
|
pkgStr += " ("
|
|
|
|
pkgStrMake += " ("
|
|
|
|
|
|
|
|
for _, split := range dc.Bases[pkg.PackageBase] {
|
|
|
|
if dc.MakeOnly.get(split.Name) {
|
|
|
|
pkgStrMake += split.Name + " "
|
|
|
|
aurMakeLen++
|
|
|
|
pushMake = true
|
|
|
|
} else {
|
|
|
|
pkgStr += split.Name + " "
|
|
|
|
aurLen++
|
|
|
|
push = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pkgStr = pkgStr[:len(pkgStr)-1] + ")"
|
|
|
|
pkgStrMake = pkgStrMake[:len(pkgStrMake)-1] + ")"
|
|
|
|
} else if dc.MakeOnly.get(pkg.Name) {
|
|
|
|
aurMakeLen++
|
|
|
|
pushMake = true
|
|
|
|
} else {
|
|
|
|
aurLen++
|
|
|
|
push = true
|
|
|
|
}
|
|
|
|
|
|
|
|
if push {
|
|
|
|
aur += pkgStr
|
|
|
|
}
|
|
|
|
if pushMake {
|
|
|
|
aurMake += pkgStrMake
|
|
|
|
}
|
2018-02-05 21:05:58 +01:00
|
|
|
}
|
2018-02-15 22:23:34 +01:00
|
|
|
|
2018-02-16 18:18:59 +01:00
|
|
|
printDownloads("Repo", repoLen, repo)
|
|
|
|
printDownloads("Repo Make", repoMakeLen, repoMake)
|
|
|
|
printDownloads("Aur", aurLen, aur)
|
|
|
|
printDownloads("Aur Make", aurMakeLen, aurMake)
|
2018-02-05 21:05:58 +01:00
|
|
|
}
|
|
|
|
|
2018-02-15 22:23:34 +01:00
|
|
|
func printDownloads(repoName string, length int, packages string) {
|
|
|
|
if length < 1 {
|
|
|
|
return
|
2018-02-05 21:05:58 +01:00
|
|
|
}
|
|
|
|
|
2018-02-15 22:23:34 +01:00
|
|
|
repoInfo := boldBlueFg(
|
|
|
|
"[" + repoName + ": " + strconv.Itoa(length) + "]")
|
2018-02-05 21:18:16 +01:00
|
|
|
fmt.Println(repoInfo + yellowFg(packages))
|
2018-02-05 21:05:58 +01:00
|
|
|
}
|
|
|
|
|
2017-08-02 19:24:03 +02:00
|
|
|
func printDeps(repoDeps []string, aurDeps []string) {
|
|
|
|
if len(repoDeps) != 0 {
|
2018-01-26 02:18:49 +01:00
|
|
|
fmt.Print(boldGreenFg(arrow + " Repository dependencies: "))
|
2017-08-02 19:24:03 +02:00
|
|
|
for _, repoD := range repoDeps {
|
2018-01-26 02:18:49 +01:00
|
|
|
fmt.Print(yellowFg(repoD) + " ")
|
2017-08-02 19:24:03 +02:00
|
|
|
}
|
|
|
|
fmt.Print("\n")
|
|
|
|
|
|
|
|
}
|
|
|
|
if len(aurDeps) != 0 {
|
2018-01-26 02:18:49 +01:00
|
|
|
fmt.Print(boldGreenFg(arrow + " AUR dependencies: "))
|
2017-08-02 19:24:03 +02:00
|
|
|
for _, aurD := range aurDeps {
|
2018-01-26 02:18:49 +01:00
|
|
|
fmt.Print(yellowFg(aurD) + " ")
|
2017-08-02 19:24:03 +02:00
|
|
|
}
|
|
|
|
fmt.Print("\n")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// PrintInfo prints package info like pacman -Si.
|
|
|
|
func PrintInfo(a *rpc.Pkg) {
|
2018-01-26 02:18:49 +01:00
|
|
|
fmt.Println(boldWhiteFg("Repository :"), "aur")
|
|
|
|
fmt.Println(boldWhiteFg("Name :"), a.Name)
|
|
|
|
fmt.Println(boldWhiteFg("Version :"), a.Version)
|
|
|
|
fmt.Println(boldWhiteFg("Description :"), a.Description)
|
|
|
|
fmt.Println(boldWhiteFg("URL :"), a.URL)
|
|
|
|
fmt.Println(boldWhiteFg("Licenses :"), strings.Join(a.License, " "))
|
|
|
|
fmt.Println(boldWhiteFg("Depends On :"), strings.Join(a.Depends, " "))
|
|
|
|
fmt.Println(boldWhiteFg("Make Deps :"), strings.Join(a.MakeDepends, " "))
|
2018-02-19 18:53:03 +01:00
|
|
|
fmt.Println(boldWhiteFg("Check Deps :"), strings.Join(a.CheckDepends, " "))
|
2018-01-26 02:18:49 +01:00
|
|
|
fmt.Println(boldWhiteFg("Optional Deps :"), strings.Join(a.OptDepends, " "))
|
|
|
|
fmt.Println(boldWhiteFg("Conflicts With :"), strings.Join(a.Conflicts, " "))
|
|
|
|
fmt.Println(boldWhiteFg("Maintainer :"), a.Maintainer)
|
|
|
|
fmt.Println(boldWhiteFg("Votes :"), a.NumVotes)
|
|
|
|
fmt.Println(boldWhiteFg("Popularity :"), a.Popularity)
|
2017-08-02 19:24:03 +02:00
|
|
|
if a.OutOfDate != 0 {
|
2018-01-26 02:18:49 +01:00
|
|
|
fmt.Println(boldWhiteFg("Out-of-date :"), "Yes")
|
2017-08-02 19:24:03 +02:00
|
|
|
}
|
2018-01-07 18:36:31 +01:00
|
|
|
|
|
|
|
fmt.Println()
|
2017-08-02 19:24:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// BiggestPackages prints the name of the ten biggest packages in the system.
|
|
|
|
func biggestPackages() {
|
2017-10-18 04:38:19 +02:00
|
|
|
localDb, err := alpmHandle.LocalDb()
|
2017-08-02 19:24:03 +02:00
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
pkgCache := localDb.PkgCache()
|
|
|
|
pkgS := pkgCache.SortBySize().Slice()
|
|
|
|
|
|
|
|
if len(pkgS) < 10 {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
for i := 0; i < 10; i++ {
|
2018-01-26 02:18:49 +01:00
|
|
|
fmt.Println(pkgS[i].Name() + ": " + yellowFg(human(pkgS[i].ISize())))
|
2017-08-02 19:24:03 +02:00
|
|
|
}
|
|
|
|
// Could implement size here as well, but we just want the general idea
|
|
|
|
}
|
2017-10-19 07:59:26 +02:00
|
|
|
|
|
|
|
// localStatistics prints installed packages statistics.
|
|
|
|
func localStatistics() error {
|
|
|
|
info, err := statistics()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
_, _, _, remoteNames, err := filterPackages()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Printf("\n Yay version r%s\n", version)
|
2018-01-26 02:18:49 +01:00
|
|
|
fmt.Println(boldCyanFg("==========================================="))
|
|
|
|
fmt.Println(boldGreenFg("Total installed packages: ") + yellowFg(strconv.Itoa(info.Totaln)))
|
|
|
|
fmt.Println(boldGreenFg("Total foreign installed packages: ") + yellowFg(strconv.Itoa(len(remoteNames))))
|
|
|
|
fmt.Println(boldGreenFg("Explicitly installed packages: ") + yellowFg(strconv.Itoa(info.Expln)))
|
|
|
|
fmt.Println(boldGreenFg("Total Size occupied by packages: ") + yellowFg(human(info.TotalSize)))
|
|
|
|
fmt.Println(boldCyanFg("==========================================="))
|
|
|
|
fmt.Println(boldGreenFg("Ten biggest packages"))
|
2017-10-19 07:59:26 +02:00
|
|
|
biggestPackages()
|
2018-01-26 02:18:49 +01:00
|
|
|
fmt.Println(boldCyanFg("==========================================="))
|
2017-10-19 07:59:26 +02:00
|
|
|
|
2018-02-17 19:08:00 +01:00
|
|
|
aurInfo(remoteNames)
|
2017-10-19 07:59:26 +02:00
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
2018-01-17 22:48:23 +01:00
|
|
|
|
|
|
|
//todo make pretty
|
|
|
|
func printMissing(missing stringSet) {
|
|
|
|
fmt.Print("Packages not found in repos or aur:")
|
2018-01-20 23:37:10 +01:00
|
|
|
for pkg := range missing {
|
|
|
|
fmt.Print(" ", pkg)
|
|
|
|
}
|
|
|
|
fmt.Println()
|
2018-01-17 22:48:23 +01:00
|
|
|
}
|
2018-01-25 21:39:26 +01:00
|
|
|
|
|
|
|
//todo make it less hacky
|
|
|
|
func printNumberOfUpdates() error {
|
2018-02-19 00:46:25 +01:00
|
|
|
//todo
|
2018-02-19 18:36:33 +01:00
|
|
|
old := os.Stdout // keep backup of the real stdout
|
2018-01-25 21:39:26 +01:00
|
|
|
os.Stdout = nil
|
2018-02-19 18:36:33 +01:00
|
|
|
_, _, localNames, remoteNames, err := filterPackages()
|
|
|
|
dt, _ := getDepTree(append(localNames, remoteNames...))
|
|
|
|
aurUp, repoUp, err := upList(dt)
|
2018-01-25 21:39:26 +01:00
|
|
|
os.Stdout = old // restoring the real stdout
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
fmt.Println(len(aurUp) + len(repoUp))
|
2018-02-21 09:41:25 +01:00
|
|
|
|
2018-01-25 21:39:26 +01:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
//todo make it less hacky
|
|
|
|
func printUpdateList() error {
|
|
|
|
old := os.Stdout // keep backup of the real stdout
|
|
|
|
os.Stdout = nil
|
2018-02-19 18:36:33 +01:00
|
|
|
_, _, localNames, remoteNames, err := filterPackages()
|
|
|
|
dt, _ := getDepTree(append(localNames, remoteNames...))
|
|
|
|
aurUp, repoUp, err := upList(dt)
|
|
|
|
|
2018-01-25 21:39:26 +01:00
|
|
|
os.Stdout = old // restoring the real stdout
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
for _, pkg := range repoUp {
|
|
|
|
fmt.Println(pkg.Name)
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, pkg := range aurUp {
|
|
|
|
fmt.Println(pkg.Name)
|
|
|
|
}
|
2018-02-19 18:36:33 +01:00
|
|
|
|
2018-01-25 21:39:26 +01:00
|
|
|
return nil
|
|
|
|
}
|
2018-01-26 02:18:49 +01:00
|
|
|
|
|
|
|
func blackBg(in string) string {
|
|
|
|
if alpmConf.Options&alpm.ConfColor > 0 {
|
|
|
|
return "\x1b[0;;40m" + in + "\x1b[0m"
|
|
|
|
}
|
|
|
|
|
|
|
|
return in
|
|
|
|
}
|
|
|
|
|
|
|
|
func redFg(in string) string {
|
|
|
|
if alpmConf.Options&alpm.ConfColor > 0 {
|
|
|
|
return "\x1b[0;31m" + in + "\x1b[0m"
|
|
|
|
}
|
|
|
|
|
|
|
|
return in
|
|
|
|
}
|
|
|
|
|
2018-01-26 12:30:33 +01:00
|
|
|
func greenFg(in string) string {
|
|
|
|
if alpmConf.Options&alpm.ConfColor > 0 {
|
|
|
|
return "\x1b[0;32m" + in + "\x1b[0m"
|
|
|
|
}
|
|
|
|
|
|
|
|
return in
|
|
|
|
}
|
|
|
|
|
2018-01-26 02:18:49 +01:00
|
|
|
func yellowFg(in string) string {
|
|
|
|
if alpmConf.Options&alpm.ConfColor > 0 {
|
|
|
|
return "\x1b[0;33m" + in + "\x1b[0m"
|
|
|
|
}
|
|
|
|
|
|
|
|
return in
|
|
|
|
}
|
|
|
|
|
2018-01-26 16:04:10 +01:00
|
|
|
func boldFg(in string) string {
|
|
|
|
if alpmConf.Options&alpm.ConfColor > 0 {
|
|
|
|
return "\x1b[1m" + in + "\x1b[0m"
|
|
|
|
}
|
|
|
|
|
|
|
|
return in
|
|
|
|
}
|
2018-01-26 02:18:49 +01:00
|
|
|
func boldGreenFg(in string) string {
|
|
|
|
if alpmConf.Options&alpm.ConfColor > 0 {
|
|
|
|
return "\x1b[1;32m" + in + "\x1b[0m"
|
|
|
|
}
|
|
|
|
|
|
|
|
return in
|
|
|
|
}
|
|
|
|
|
|
|
|
func boldYellowFg(in string) string {
|
|
|
|
if alpmConf.Options&alpm.ConfColor > 0 {
|
|
|
|
return "\x1b[1;33m" + in + "\x1b[0m"
|
|
|
|
}
|
|
|
|
|
|
|
|
return in
|
|
|
|
}
|
|
|
|
|
2018-01-26 12:30:33 +01:00
|
|
|
func boldBlueFg(in string) string {
|
|
|
|
if alpmConf.Options&alpm.ConfColor > 0 {
|
|
|
|
return "\x1b[1;34m" + in + "\x1b[0m"
|
|
|
|
}
|
|
|
|
|
|
|
|
return in
|
|
|
|
}
|
|
|
|
|
2018-01-26 02:18:49 +01:00
|
|
|
func boldCyanFg(in string) string {
|
|
|
|
if alpmConf.Options&alpm.ConfColor > 0 {
|
|
|
|
return "\x1b[1;36m" + in + "\x1b[0m"
|
|
|
|
}
|
|
|
|
|
|
|
|
return in
|
|
|
|
}
|
|
|
|
|
|
|
|
func boldWhiteFg(in string) string {
|
|
|
|
if alpmConf.Options&alpm.ConfColor > 0 {
|
|
|
|
return "\x1b[1;37m" + in + "\x1b[0m"
|
|
|
|
}
|
|
|
|
|
|
|
|
return in
|
|
|
|
}
|
|
|
|
|
|
|
|
func redFgBlackBg(in string) string {
|
|
|
|
if alpmConf.Options&alpm.ConfColor > 0 {
|
2018-01-26 12:30:33 +01:00
|
|
|
return "\x1b[0;31;40m" + in + "\x1b[0m"
|
2018-01-26 02:18:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return in
|
|
|
|
}
|
|
|
|
|
|
|
|
func greenFgBlackBg(in string) string {
|
|
|
|
if alpmConf.Options&alpm.ConfColor > 0 {
|
2018-01-26 12:30:33 +01:00
|
|
|
return "\x1b[0;32;40m" + in + "\x1b[0m"
|
2018-01-26 02:18:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return in
|
|
|
|
}
|
|
|
|
|
|
|
|
func whiteFgBlackBg(in string) string {
|
|
|
|
if alpmConf.Options&alpm.ConfColor > 0 {
|
|
|
|
return "\x1b[0;37;40m" + in + "\x1b[0m"
|
|
|
|
}
|
|
|
|
|
|
|
|
return in
|
|
|
|
}
|
|
|
|
|
|
|
|
func boldRedFgBlackBg(in string) string {
|
|
|
|
if alpmConf.Options&alpm.ConfColor > 0 {
|
|
|
|
return "\x1b[1;31;40m" + in + "\x1b[0m"
|
|
|
|
}
|
|
|
|
|
|
|
|
return in
|
|
|
|
}
|
|
|
|
|
|
|
|
func boldYellowFgBlackBg(in string) string {
|
|
|
|
if alpmConf.Options&alpm.ConfColor > 0 {
|
|
|
|
return "\x1b[1;33;40m" + in + "\x1b[0m"
|
|
|
|
}
|
|
|
|
|
|
|
|
return in
|
|
|
|
}
|