Accept verbosity in rustdoc.

This commit is contained in:
O01eg 2017-12-03 14:09:12 +03:00
parent ee8b5783af
commit 27b4f225ea
No known key found for this signature in database
GPG Key ID: D1A94F2400FBC7E5

View File

@ -27,6 +27,13 @@ fn main() {
let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set");
let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set");
use std::str::FromStr;
let verbose = match env::var("RUSTC_VERBOSE") {
Ok(s) => usize::from_str(&s).expect("RUSTC_VERBOSE should be an integer"),
Err(_) => 0,
};
let mut dylib_path = bootstrap::util::dylib_path();
dylib_path.insert(0, PathBuf::from(libdir));
@ -63,6 +70,10 @@ fn main() {
cmd.arg("--deny-render-differences");
}
if verbose > 1 {
eprintln!("rustdoc command: {:?}", cmd);
}
std::process::exit(match cmd.status() {
Ok(s) => s.code().unwrap_or(1),
Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),