From 19163dce2cdcf06548f075208830eb1c8d0a2abe Mon Sep 17 00:00:00 2001 From: Jonathan Dahan Date: Wed, 11 Sep 2019 18:28:47 -0400 Subject: [PATCH] use env! for name and version --- src/main.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3c41df6..5bfff16 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,6 +17,9 @@ pub mod plugins; use crate::identifier::Identifier; use crate::plugins::Plugins; +const NAME: &str = env!("CARGO_PKG_NAME"); +const VERSION: &str = env!("CARGO_PKG_VERSION"); + /// We have three main commands /// /// `load`: download and print sourceable zsh to load scripts @@ -40,13 +43,13 @@ fn main() { fn print_help() { println!(" - zr {version} + {name} {version} by Jonathan Dahan - zr help show help - zr list list cached plugins - zr update update plugin repositories - zr load generate file to source from [http://example.com/]plugin/name[.git/path/to/file.zsh]", version=env!("CARGO_PKG_VERSION")) + {name} help show help + {name} list list cached plugins + {name} update update plugin repositories + {name} load generate file to source from [http://example.com/]plugin/name[.git/path/to/file.zsh]", version=VERSION, name=NAME) } /// Create plugins from an existing `load` output