From ffaa609fdf1fa3879deb82e5e0ee0891915e525e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=9E=E3=83=AA=E3=82=A6=E3=82=B9?= Date: Fri, 16 Oct 2020 01:07:26 +0100 Subject: [PATCH] Added colors --- z/import.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/z/import.go b/z/import.go index 61f342c..a5ae865 100644 --- a/z/import.go +++ b/z/import.go @@ -5,6 +5,7 @@ import ( "fmt" "time" "github.com/spf13/cobra" + "github.com/gookit/color" "github.com/cnf/structhash" ) @@ -79,17 +80,17 @@ var importCmd = &cobra.Command{ for _, entry := range entries { if id, ok := sha1List[entry.SHA1]; ok { - fmt.Printf("%s %s was previously imported as %s; not importing again\n", CharInfo, entry.SHA1, id) + fmt.Printf("%s %s was previously imported as %s; not importing again\n", CharInfo, color.FgLightWhite.Render(entry.SHA1), color.FgLightWhite.Render(id)) continue } importedId, err := database.AddEntry(user, entry, false) if err != nil { - fmt.Printf("%s %s could not be imported: %+v\n", CharError, entry.SHA1, err) + fmt.Printf("%s %s could not be imported: %+v\n", CharError, color.FgLightWhite.Render(entry.SHA1), color.FgRed.Render(err)) continue } - fmt.Printf("%s %s was imported as %s\n", CharInfo, entry.SHA1, importedId) + fmt.Printf("%s %s was imported as %s\n", CharInfo, color.FgLightWhite.Render(entry.SHA1), color.FgLightWhite.Render(importedId)) sha1List[entry.SHA1] = importedId }