Print correct version of bin tools (#183)

* Print correct version of bin tools

Not something important, but I use these tools for some testing and
they print wrong version with --version flag.
This commit is contained in:
Salim Shaaban Salim
2019-07-03 19:12:32 +01:00
committed by Dan Gohman
parent 210e959333
commit 89cd327c97
3 changed files with 6 additions and 3 deletions

View File

@@ -86,10 +86,11 @@ fn read_wasm_file(path: PathBuf) -> Result<Vec<u8>, io::Error> {
} }
fn main() { fn main() {
let version = env!("CARGO_PKG_VERSION");
let args: Args = Docopt::new(USAGE) let args: Args = Docopt::new(USAGE)
.and_then(|d| { .and_then(|d| {
d.help(true) d.help(true)
.version(Some(String::from("0.0.0"))) .version(Some(String::from(version)))
.deserialize() .deserialize()
}) })
.unwrap_or_else(|e| e.exit()); .unwrap_or_else(|e| e.exit());

View File

@@ -191,10 +191,11 @@ fn compute_environ(flag_env: &[String]) -> Vec<(String, String)> {
} }
fn main() { fn main() {
let version = env!("CARGO_PKG_VERSION");
let args: Args = Docopt::new(USAGE) let args: Args = Docopt::new(USAGE)
.and_then(|d| { .and_then(|d| {
d.help(true) d.help(true)
.version(Some(String::from("0.0.0"))) .version(Some(String::from(version)))
.deserialize() .deserialize()
}) })
.unwrap_or_else(|e| e.exit()); .unwrap_or_else(|e| e.exit());

View File

@@ -64,10 +64,11 @@ struct Args {
} }
fn main() { fn main() {
let version = env!("CARGO_PKG_VERSION");
let args: Args = Docopt::new(USAGE) let args: Args = Docopt::new(USAGE)
.and_then(|d| { .and_then(|d| {
d.help(true) d.help(true)
.version(Some(String::from("0.0.0"))) .version(Some(String::from(version)))
.deserialize() .deserialize()
}) })
.unwrap_or_else(|e| e.exit()); .unwrap_or_else(|e| e.exit());