From f0ccbb2fcf4cd35f2d46a45fe88bc4bf6e91fde2 Mon Sep 17 00:00:00 2001 From: Guanqun Lu Date: Tue, 21 Nov 2017 14:28:11 +0800 Subject: [PATCH] move version out of yaml and let it populate dynamically from package info --- cli/src/cli.yml | 1 - cli/src/lib.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cli/src/cli.yml b/cli/src/cli.yml index 7e8221311d63e..a23ba5c2356da 100644 --- a/cli/src/cli.yml +++ b/cli/src/cli.yml @@ -1,5 +1,4 @@ name: polkadot -version: "1.0.0" author: "Parity Team " about: Polkadot Node Rust Implementation args: diff --git a/cli/src/lib.rs b/cli/src/lib.rs index e1086f8d6c27a..dfd7080451208 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -46,7 +46,7 @@ pub fn run(args: I) -> error::Result<()> where T: Into + Clone, { let yaml = load_yaml!("./cli.yml"); - let matches = clap::App::from_yaml(yaml).get_matches_from_safe(args)?; + let matches = clap::App::from_yaml(yaml).version(crate_version!()).get_matches_from_safe(args)?; // TODO [ToDr] Split paremeters parsing from actual execution. let log_pattern = matches.value_of("log").unwrap_or("");