Support -V/--version on all CLI apps

All CLI apps that use clap (in other words, except for bench-streamer)
can use crate_version! to take the version from Cargo.toml.

This change addresses #700.
This commit is contained in:
Kazuyoshi Kato
2018-08-06 20:51:12 -07:00
committed by Michael Vines
parent 5dc7177540
commit efc72b9572
8 changed files with 15 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
#[macro_use]
extern crate clap;
extern crate getopts;
extern crate log;
@@ -23,6 +24,7 @@ fn main() -> () {
logger::setup();
set_panic_hook("fullnode");
let matches = App::new("fullnode")
.version(crate_version!())
.arg(
Arg::with_name("identity")
.short("i")