From b3e0cd6699f456382fa8b8f34c9575ff69e0b74c Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 27 Mar 2023 10:59:11 -0700 Subject: [PATCH] Added version string --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 14 ++++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3442e87..68d631e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,7 +10,7 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "calc" -version = "0.1.0" +version = "0.0.1" dependencies = [ "signal-hook", "termion", diff --git a/Cargo.toml b/Cargo.toml index 7e40d36..8314ca6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "calc" -version = "0.1.0" +version = "0.0.1" edition = "2021" [profile.release] diff --git a/src/main.rs b/src/main.rs index 8603a76..e1c939b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,13 +41,19 @@ fn draw_greeter(stdout: &mut RawTerminal) -> Result<(), std::io {b}@@ @{a}# ##\r\n \ {b}@ @@{a}## #\r\n \ {b} @@@@@@ {a} ###### {r}\r\n \ - \n {t}Daisy{r} {v}v0.0.0{r}\r\n\n", + \n {t}Daisy{r} {v}v{ver}{r}\r\n\n", + r = format!("{}{}", color::Fg(color::Reset), style::Reset), + + // Icon colors a = color::Fg(color::Magenta), b = color::Fg(color::White), - t = format!("{}{}", color::Fg(color::White), style::Bold), - v = format!("{}{}", color::Fg(color::White), style::Italic), - r = format!("{}{}", color::Fg(color::Reset), style::Reset), + // Title format + t = format!("{}{}", color::Fg(color::White), style::Bold), + + // Version + v = format!("{}{}", color::Fg(color::White), style::Italic), + ver = env!("CARGO_PKG_VERSION"), )?; return Ok(());