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,4 +1,5 @@
extern crate bincode;
#[macro_use]
extern crate clap;
extern crate influx_db_client;
extern crate rayon;
@ -377,6 +378,7 @@ fn main() {
let mut tx_count = 500_000;
let matches = App::new("solana-bench-tps")
.version(crate_version!())
.arg(
Arg::with_name("leader")
.short("l")

View File

@ -1,4 +1,5 @@
extern crate bincode;
#[macro_use]
extern crate clap;
extern crate serde_json;
extern crate solana;
@ -26,6 +27,7 @@ fn main() {
logger::setup();
set_panic_hook("drone");
let matches = App::new("drone")
.version(crate_version!())
.arg(
Arg::with_name("leader")
.short("l")

View File

@ -1,3 +1,4 @@
#[macro_use]
extern crate clap;
extern crate dirs;
extern crate serde_json;
@ -13,6 +14,7 @@ use std::net::SocketAddr;
fn main() {
let matches = App::new("fullnode-config")
.version(crate_version!())
.arg(
Arg::with_name("local")
.short("l")

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

View File

@ -16,6 +16,7 @@ use std::process::exit;
fn main() -> Result<(), Box<error::Error>> {
let matches = App::new("solana-genesis")
.version(crate_version!())
.arg(
Arg::with_name("tokens")
.short("t")

View File

@ -1,3 +1,4 @@
#[macro_use]
extern crate clap;
extern crate dirs;
extern crate ring;
@ -13,6 +14,7 @@ use std::path::Path;
fn main() -> Result<(), Box<error::Error>> {
let matches = App::new("solana-keygen")
.version(crate_version!())
.arg(
Arg::with_name("outfile")
.short("o")

View File

@ -1,3 +1,4 @@
#[macro_use]
extern crate clap;
extern crate serde_json;
extern crate solana;
@ -12,6 +13,7 @@ use std::process::exit;
fn main() {
logger::setup();
let matches = App::new("ledger-tool")
.version(crate_version!())
.arg(
Arg::with_name("ledger")
.short("l")

View File

@ -1,6 +1,7 @@
extern crate atty;
extern crate bincode;
extern crate bs58;
#[macro_use]
extern crate clap;
extern crate dirs;
extern crate serde_json;
@ -74,6 +75,7 @@ impl Default for WalletConfig {
fn parse_args() -> Result<WalletConfig, Box<error::Error>> {
let matches = App::new("solana-wallet")
.version(crate_version!())
.arg(
Arg::with_name("leader")
.short("l")