From 0a889f38d4cc33e7bf1b447a771e6c8da24a20f4 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 16 Sep 2026 22:31:01 -0400 Subject: [PATCH] added pretty print to list function --- client.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index 5c5f3de..160f0e4 100644 --- a/client.go +++ b/client.go @@ -1,7 +1,7 @@ // ============================================================================= // Auth: alex // File: client.go -// Revn: 09-15-2026 3.0.3 +// Revn: 09-16-2026 4.0.0 // Func: ask server for a message of the day quote // // TODO: remove ioutil import @@ -51,6 +51,8 @@ // changed edit command to be add and then remove instead // of remove and then add, fixing server OOB error when // editting only quote in list +//#09-15-2026: finished pretty print implementation +// made listAnswer() print list with color print // // ============================================================================= @@ -320,7 +322,8 @@ func listAnswer( subcom []string ) string { quotes := strings.Split( subcom[0], "\n" ) for p, v := range quotes { // iterate over quotes // print num of quote, followed by that quote - fmt.Println( p + 1, "\t", v ) + fmt.Print( p + 1, "\t" ) + quoteAnswer( []string{ v } ) } resp = "te@success" // set transaction end message } @@ -587,7 +590,7 @@ func main() { flag.Parse() // FIXME get better versioning method - VERS = "3.0.3" + VERS = "4.0.0" if vv { // display info and exit fmt.Println( "ekho client v" + VERS )