From 59ea31a0772f83898b4828ae5d91e5992eb38584 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 20 Feb 2018 17:45:14 +0100 Subject: [PATCH] Use the make_imag_version!() helper --- bin/core/imag-init/Cargo.toml | 1 + bin/core/imag-init/src/main.rs | 4 +++- bin/core/imag-init/src/ui.rs | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/core/imag-init/Cargo.toml b/bin/core/imag-init/Cargo.toml index 7e9ff997..f39265de 100644 --- a/bin/core/imag-init/Cargo.toml +++ b/bin/core/imag-init/Cargo.toml @@ -23,6 +23,7 @@ maintenance = { status = "actively-developed" } [dependencies] libimagerror = { version = "0.7.0", path = "../../../lib/core/libimagerror" } +libimagrt = { version = "0.7.0", path = "../../../lib/core/libimagrt" } [dependencies.clap] version = ">=2.29" diff --git a/bin/core/imag-init/src/main.rs b/bin/core/imag-init/src/main.rs index 8688481d..742ad20c 100644 --- a/bin/core/imag-init/src/main.rs +++ b/bin/core/imag-init/src/main.rs @@ -37,6 +37,7 @@ extern crate clap; #[cfg(test)] extern crate toml; +#[macro_use] extern crate libimagrt; extern crate libimagerror; mod ui; @@ -66,7 +67,8 @@ imagrc.toml "#; fn main() { - let app = ui::build_ui(); + let version = make_imag_version!(); + let app = ui::build_ui(&version); let matches = app.get_matches(); let mut out = ::std::io::stdout(); diff --git a/bin/core/imag-init/src/ui.rs b/bin/core/imag-init/src/ui.rs index ab86b738..ff985290 100644 --- a/bin/core/imag-init/src/ui.rs +++ b/bin/core/imag-init/src/ui.rs @@ -19,9 +19,9 @@ use clap::{Arg, App}; -pub fn build_ui<'a>() -> App<'a, 'a> { +pub fn build_ui<'a>(version: &'a str) -> App<'a, 'a> { App::new("imag-init") - .version(env!("CARGO_PKG_VERSION")) + .version(version) .author("Matthias Beyer ") .about("Initialize a ~/.imag repository. Optionally with git")