banner
This commit is contained in:
parent
f7c52513f4
commit
3fc20170f2
1
serra.go
1
serra.go
@ -49,6 +49,7 @@ Options:
|
|||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
serra.Banner()
|
||||||
if opts.Add {
|
if opts.Add {
|
||||||
serra.Add(opts.Card, opts.Count)
|
serra.Add(opts.Card, opts.Count)
|
||||||
} else if opts.Remove {
|
} else if opts.Remove {
|
||||||
|
|||||||
@ -16,7 +16,6 @@ const (
|
|||||||
|
|
||||||
// Add
|
// Add
|
||||||
func Add(cards []string, count int64) error {
|
func Add(cards []string, count int64) error {
|
||||||
LogMessage(fmt.Sprintf("Serra %v\n", version), "green")
|
|
||||||
|
|
||||||
client := storage_connect()
|
client := storage_connect()
|
||||||
coll := &Collection{client.Database("serra").Collection("cards")}
|
coll := &Collection{client.Database("serra").Collection("cards")}
|
||||||
@ -55,7 +54,6 @@ func Add(cards []string, count int64) error {
|
|||||||
|
|
||||||
// Remove
|
// Remove
|
||||||
func Remove(cards []string) {
|
func Remove(cards []string) {
|
||||||
LogMessage(fmt.Sprintf("Serra %v\n", version), "green")
|
|
||||||
|
|
||||||
client := storage_connect()
|
client := storage_connect()
|
||||||
coll := &Collection{client.Database("serra").Collection("cards")}
|
coll := &Collection{client.Database("serra").Collection("cards")}
|
||||||
@ -83,7 +81,6 @@ func Remove(cards []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Cards() {
|
func Cards() {
|
||||||
LogMessage(fmt.Sprintf("Serra %v\n", version), "green")
|
|
||||||
|
|
||||||
client := storage_connect()
|
client := storage_connect()
|
||||||
coll := &Collection{client.Database("serra").Collection("cards")}
|
coll := &Collection{client.Database("serra").Collection("cards")}
|
||||||
@ -99,7 +96,6 @@ func Cards() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Sets() {
|
func Sets() {
|
||||||
LogMessage(fmt.Sprintf("Serra %v\n", version), "green")
|
|
||||||
|
|
||||||
client := storage_connect()
|
client := storage_connect()
|
||||||
coll := &Collection{client.Database("serra").Collection("cards")}
|
coll := &Collection{client.Database("serra").Collection("cards")}
|
||||||
@ -126,7 +122,6 @@ func Sets() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ShowSet(setname string) error {
|
func ShowSet(setname string) error {
|
||||||
LogMessage(fmt.Sprintf("Serra %v\n", version), "green")
|
|
||||||
|
|
||||||
client := storage_connect()
|
client := storage_connect()
|
||||||
coll := &Collection{client.Database("serra").Collection("cards")}
|
coll := &Collection{client.Database("serra").Collection("cards")}
|
||||||
@ -175,7 +170,6 @@ func ShowSet(setname string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Update() error {
|
func Update() error {
|
||||||
LogMessage(fmt.Sprintf("Serra %v\n", version), "green")
|
|
||||||
|
|
||||||
client := storage_connect()
|
client := storage_connect()
|
||||||
|
|
||||||
@ -221,7 +215,6 @@ func Update() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Stats() {
|
func Stats() {
|
||||||
LogMessage(fmt.Sprintf("Serra %v\n", version), "green")
|
|
||||||
|
|
||||||
LogMessage(fmt.Sprintf("Color distribution in Collection"), "green")
|
LogMessage(fmt.Sprintf("Color distribution in Collection"), "green")
|
||||||
client := storage_connect()
|
client := storage_connect()
|
||||||
|
|||||||
@ -2,23 +2,34 @@ package serra
|
|||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
const (
|
var (
|
||||||
challengeLimiter string = ">> "
|
Icon = "\U0001F47C\U0001F3FB" // baby angel serra
|
||||||
colorCyan string = "\033[36m"
|
Reset = "\033[0m"
|
||||||
colorGreen string = "\033[32m"
|
Background = "\033[38;5;59m"
|
||||||
colorPurple string = "\033[35m"
|
CurrentLine = "\033[38;5;60m"
|
||||||
colorRed string = "\033[31m"
|
Foreground = "\033[38;5;231m"
|
||||||
colorReset string = "\033[0m"
|
Comment = "\033[38;5;103m"
|
||||||
|
Cyan = "\033[38;5;159m"
|
||||||
|
Green = "\033[38;5;120m"
|
||||||
|
Orange = "\033[38;5;222m"
|
||||||
|
Pink = "\033[38;5;212m"
|
||||||
|
Purple = "\033[38;5;183m"
|
||||||
|
Red = "\033[38;5;210m"
|
||||||
|
Yellow = "\033[38;5;229m"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func Banner() {
|
||||||
|
LogMessage(fmt.Sprintf("%s Serra %v\n", Icon, version), "green")
|
||||||
|
}
|
||||||
|
|
||||||
// Colored output on commandline
|
// Colored output on commandline
|
||||||
func LogMessage(message string, color string) {
|
func LogMessage(message string, color string) {
|
||||||
if color == "red" {
|
if color == "red" {
|
||||||
fmt.Printf("%s%s%s\n", colorRed, message, colorReset)
|
fmt.Printf("%s%s%s\n", Red, message, Reset)
|
||||||
} else if color == "green" {
|
} else if color == "green" {
|
||||||
fmt.Printf("%s%s%s\n", colorGreen, message, colorReset)
|
fmt.Printf("%s%s%s\n", Green, message, Reset)
|
||||||
} else if color == "purple" {
|
} else if color == "purple" {
|
||||||
fmt.Printf("%s%s%s\n", colorPurple, message, colorReset)
|
fmt.Printf("%s%s%s\n", Purple, message, Reset)
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("%s\n", message)
|
fmt.Printf("%s\n", message)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user