Skip to content

Commit

Permalink
rustc_driver: Print stage info in --version --verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
richo committed Jul 6, 2015
1 parent 20f421c commit 555b021
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/librustc_driver/lib.rs
Expand Up @@ -481,6 +481,21 @@ pub fn commit_date_str() -> Option<&'static str> {
option_env!("CFG_VER_DATE")
}

/// Returns a stage string, such as "stage0".
pub fn stage_str() -> Option<&'static str> {
if cfg!(stage0) {
Some("stage0")
} else if cfg!(stage1) {
Some("stage1")
} else if cfg!(stage2) {
Some("stage2")
} else if cfg!(stage3) {
Some("stage3")
} else {
None
}
}

/// Prints version information
pub fn version(binary: &str, matches: &getopts::Matches) {
let verbose = matches.opt_present("verbose");
Expand All @@ -493,6 +508,7 @@ pub fn version(binary: &str, matches: &getopts::Matches) {
println!("commit-date: {}", unw(commit_date_str()));
println!("host: {}", config::host_triple());
println!("release: {}", unw(release_str()));
println!("stage: {}", unw(stage_str()));
}
}

Expand Down

0 comments on commit 555b021

Please sign in to comment.