💄 Changed rendering

Changed color rendering.
This commit is contained in:
perp 2023-08-02 05:09:28 +01:00
parent ddeebf17ce
commit 038362f6f2

View File

@ -8,9 +8,8 @@ import (
)
// Return your account information
func Info(api_enabled, profile_enabled bool) {
func Info(profile_enabled bool) {
// Fetch API information
if api_enabled {
results, err := utils.Client.GetAPIInfo(context.Background())
if err != nil {
fmt.Printf("%s: %s\n", utils.Red("Error"), err.Error())
@ -25,12 +24,6 @@ func Info(api_enabled, profile_enabled bool) {
fmt.Printf("%s: %s\n", utils.Blue("Telnet"), utils.Green(results.Telnet))
fmt.Printf("%s: %s\n", utils.Green("HTTPS"), utils.Blue(results.HTTPS))
fmt.Printf("%s: %s\n", utils.Blue("Unlocked"), utils.Green(results.Unlocked))
}
// Add newline
if api_enabled && profile_enabled {
fmt.Println("")
}
// Fetch profile information
if profile_enabled {
@ -40,9 +33,21 @@ func Info(api_enabled, profile_enabled bool) {
return
}
// Profile name
var name string
// Empty name
if results.Name == "" {
name = "?"
} else {
name = results.Name
}
// Print results
fmt.Println("")
utils.Title.Println("Profile")
fmt.Printf("%s: %s\n", utils.Green("Name"), utils.Blue(results.Name))
fmt.Printf("%s: %s\n", utils.Green("Name"), utils.Blue(name))
fmt.Printf("%s: %s\n", utils.Blue("Member"), utils.Green(results.Member))
fmt.Printf("%s: %s\n", utils.Green("Credits"), utils.Blue(results.Credits))
fmt.Printf("%s: %s\n", utils.Blue("Created"), utils.Green(results.Created))