Skip to content

Commit

Permalink
make cargo --version --verbose print extra information
Browse files Browse the repository at this point in the history
Fixes #3584.
  • Loading branch information
froydnj committed Jan 27, 2017
1 parent 579aa1a commit 50e1c1a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/bin/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,18 @@ fn execute(flags: Flags, config: &Config) -> CliResult<Option<()>> {
let _token = cargo::util::job::setup();

if flags.flag_version {
println!("{}", cargo::version());
let version = cargo::version();
println!("{}", version);
if flags.flag_verbose > 0{
println!("release: {}.{}.{}",
version.major, version.minor, version.patch);
if let Some(ref cfg) = version.cfg_info {
if let Some(ref ci) = cfg.commit_info {
println!("commit-hash: {}", ci.commit_hash);
println!("commit-date: {}", ci.commit_date);
}
}
}
return Ok(None)
}

Expand Down

0 comments on commit 50e1c1a

Please sign in to comment.