Skip to content

Commit

Permalink
Add color to usage and banner
Browse files Browse the repository at this point in the history
  • Loading branch information
hahwul committed Feb 9, 2021
1 parent 23182be commit 232cb8e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module github.com/hahwul/gee

go 1.15

require github.com/logrusorgru/aurora v2.0.3+incompatible
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
app "github.com/hahwul/gee/pkg/gee"
model "github.com/hahwul/gee/pkg/model"
printing "github.com/hahwul/gee/pkg/printing"
"github.com/logrusorgru/aurora"
)

func main() {
Expand All @@ -28,9 +29,9 @@ func main() {
// Custom usage
flag.Usage = func() {
printing.Banner()
fmt.Fprintf(os.Stderr, "Usage: %s [flags] [file1] [file2] ...\n", os.Args[0])
fmt.Fprintf(os.Stderr, aurora.White("Usage: %s [flags] [file1] [file2] ...\n").String(), os.Args[0])
fmt.Fprintf(os.Stderr, "(If you do not specify a file, only stdout is output)\n\n")
fmt.Fprintf(os.Stderr, "Flags\n")
fmt.Fprintf(os.Stderr, aurora.White("Flags:\n").String())
flag.PrintDefaults()
}

Expand Down
12 changes: 7 additions & 5 deletions pkg/printing/banner.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ package printing
import (
"fmt"
"os"

"github.com/logrusorgru/aurora"
)

// Banner is banner of gee
func Banner() {
fmt.Fprintln(os.Stderr, "._____ ._______._______")
fmt.Fprintln(os.Stderr, ":_ ___\\ : .____/: .____/")
fmt.Fprintln(os.Stderr, "| |___| : _/\\ | : _/\\ ")
fmt.Fprintln(os.Stderr, "| / || / \\| / \\")
fmt.Fprintln(os.Stderr, aurora.White("._____ ._______._______").String())
fmt.Fprintln(os.Stderr, aurora.White(":_ ___\\ : .____/: .____/").String())
fmt.Fprintln(os.Stderr, aurora.White("| |___| : _/\\ | : _/\\ ").String())
fmt.Fprintln(os.Stderr, aurora.White("| / || / \\| / \\").String())
fmt.Fprintln(os.Stderr, "|. __ ||_.: __/|_.: __/")
fmt.Fprintln(os.Stderr, ":/ |. | :/ :/")
fmt.Fprintln(os.Stderr, ": : / "+VERSION)
fmt.Fprintln(os.Stderr, ": : / "+aurora.BrightYellow("{"+VERSION+"}").String())
fmt.Fprintln(os.Stderr, " : ")
}

0 comments on commit 232cb8e

Please sign in to comment.