Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color print #113

Merged
merged 4 commits into from
Jan 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}
}
Expand Down
8 changes: 5 additions & 3 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,12 @@ func editor() string {
}
fallthrough
default:
fmt.Printf("\x1b[1;31;40mWarning: \x1B[1;33;40m$EDITOR\x1b[0;37;40m is not set.\x1b[0m\nPlease add $EDITOR or to your environment variables.\n")
fmt.Println(boldRedFgBlackBg("Warning:"),
boldYellowFgBlackBg("$EDITOR"), whiteFgBlackBg("is not set"))
fmt.Println("Please add $EDITOR or to your environment variables.")

editorLoop:
fmt.Printf("\x1b[32m%s\x1b[0m ", "Edit PKGBUILD with:")
fmt.Print(greenFg("Edit PKGBUILD with:"))
var editorInput string
_, err := fmt.Scanln(&editorInput)
if err != nil {
Expand Down Expand Up @@ -181,7 +183,7 @@ func continueTask(s string, def string) (cont bool) {
}

var response string
fmt.Printf("\x1b[1;32m==> %s\x1b[1;37m %s\x1b[0m", s, postFix)
fmt.Println(boldGreenFg(arrow+" "+s), boldWhiteFg(postFix))

n, err := fmt.Scanln(&response)
if err != nil || n == 0 {
Expand Down
4 changes: 2 additions & 2 deletions download.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func getPkgbuildfromABS(pkgN string, path string) (err error) {
} else {
return fmt.Errorf("Not in standard repositories")
}
fmt.Printf("\x1b[1;32m==>\x1b[1;33m %s \x1b[1;32mfound in ABS.\x1b[0m\n", pkgN)
fmt.Println(boldGreenFg(arrow), boldYellowFg(pkgN), boldGreenFg("found in ABS."))
errD := downloadAndUnpack(url, path, true)
return errD
}
Expand All @@ -116,7 +116,7 @@ func getPkgbuildfromAUR(pkgN string, dir string) (err error) {
return fmt.Errorf("no results")
}

fmt.Printf("\x1b[1;32m==>\x1b[1;33m %s \x1b[1;32mfound in AUR.\x1b[0m\n", pkgN)
fmt.Println(boldGreenFg(arrow), boldYellowFg(pkgN), boldGreenFg("found in AUR."))
downloadAndUnpack(baseURL+aq[0].URLPath, dir, false)
return
}
6 changes: 4 additions & 2 deletions install.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ func install(parser *arguments) error {

for _, pkg := range dc.AurMake {
if pkg.Maintainer == "" {
fmt.Printf("\x1b[1;31;40m==> Warning:\x1b[0;;40m %s is orphaned.\x1b[0m\n", pkg.Name+"-"+pkg.Version)
fmt.Println(boldRedFgBlackBg(arrow+"Warning:"),
blackBg(pkg.Name+"-"+pkg.Version+"is orphaned"))
}
}

for _, pkg := range dc.Aur {
if pkg.Maintainer == "" {
fmt.Printf("\x1b[1;31;40m==> Warning:\x1b[0;;40m %s is orphaned.\x1b[0m\n", pkg.Name+"-"+pkg.Version)
fmt.Println(boldRedFgBlackBg(arrow+"Warning:"),
blackBg(pkg.Name+"-"+pkg.Version+"is orphaned"))
}
}

Expand Down
Loading