From d894d6d475f2fd30f55f36530d2522df22460e4a Mon Sep 17 00:00:00 2001 From: shy Date: Wed, 7 Apr 2021 07:48:53 +0200 Subject: [PATCH] Make use of Cargo environment variables. --- src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6d43ea7..16e6005 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,10 +19,10 @@ use alarm::{Countdown, AlarmRoster, alarm_exec}; use layout::{Layout, Position}; -const NAME: &str = "kitchentimer"; -const VERSION: &str = "0.0.1"; -const USAGE: &str = -"USAGE: kitchentimer [-h|-v] [-p] [ALARM TIME(s)] [-e|--exec COMMAND [...]] +const NAME: &str = env!("CARGO_PKG_NAME"); +const VERSION: &str = env!("CARGO_PKG_VERSION"); +const USAGE: &str = concat!("USAGE: ", env!("CARGO_PKG_NAME"), +" [-h|-v] [-p] [ALARM TIME(s)] [-e|--exec COMMAND [...]] PARAMETERS: [ALARM TIME] None or multiple alarm times (HH:MM:SS). OPTIONS: @@ -35,7 +35,7 @@ OPTIONS: with the elapsed time in (HH:)MM:SS format. SIGNALS: Reset clock. - Pause or un-pause clock."; + Pause or un-pause clock."); const MENUBAR: &str = "[0-9] Add alarm [d] Delete alarm [SPACE] Pause [r] Reset [c] Clear color [q] Quit"; const MENUBAR_SHORT: &str =