From ed82e7f17bbe2941d48bee6f1d06f9ce8715f604 Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 7 Jun 2023 14:52:02 -0700 Subject: [PATCH] Centered greeter --- src/command/mod.rs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/command/mod.rs b/src/command/mod.rs index 974d2fd..e3c1640 100644 --- a/src/command/mod.rs +++ b/src/command/mod.rs @@ -25,15 +25,17 @@ pub fn is_command( fn draw_greeter(stdout: &mut RawTerminal) -> Result<(), std::io::Error> { write!( stdout, - "\n \ - {a} ###### {b} @@@@@@\r\n \ - {a}# ##{b}@@ @\r\n \ - {a}## #{b}@ @@\r\n \ - {a} {b}@@@@@@@@@@@@@{a}\r\n \ - {b}@@ @{a}# ##\r\n \ - {b}@ @@{a}## #\r\n \ - {b} @@@@@@ {a} ###### {r}\r\n \ - \n {t}Daisy{r} {v}v{ver}{r}\r\n\n", + concat!( + "{a} ###### {b} @@@@@@\r\n", + "{a} # ##{b}@@ @\r\n", + "{a} ## #{b}@ @@\r\n", + "{a} {b}@@@@@@@@@@@@@{a}\r\n", + "{b} @@ @{a}# ##\r\n", + "{b} @ @@{a}## #\r\n", + "{b} @@@@@@ {a} ###### {r}\r\n", + " {t}Daisy{r} {v}v{ver}{r}\r\n", + "\n" + ), r = format!("{}{}", color::Fg(color::Reset), style::Reset), a = color::Fg(color::Magenta), b = color::Fg(color::White), @@ -65,7 +67,8 @@ pub fn do_command( //" {c}units{r} List available units\r\n", //" {c}const{r} List available constants\r\n", " {c}ops{r} List built-in operators\r\n", - " {c}fns{r} List built-in functions\r\n" + " {c}fns{r} List built-in functions\r\n", + "\n" ), r = format!("{}{}", color::Fg(color::Reset), style::Reset),