Merge pull request #1304 from matthiasbeyer/imag-init/imag-version-generator

Use the make_imag_version!() helper
This commit is contained in:
Matthias Beyer 2018-02-20 19:21:08 +01:00 committed by GitHub
commit f38a4eb723
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View file

@ -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"

View file

@ -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();

View file

@ -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 <mail@beyermatthias.de>")
.about("Initialize a ~/.imag repository. Optionally with git")