use cargo::execute_main_without_stdin;
use cargo::util::ChainError;
use cargo::util::{self, CliResult, lev_distance, Config, human, CargoResult};
+use cargo::util::process_builder::process;
#[derive(RustcDecodable)]
pub struct Flags {
flag_verbose: Option<bool>,
flag_quiet: Option<bool>,
flag_color: Option<String>,
+ flag_explain: Option<String>,
arg_command: String,
arg_args: Vec<String>,
}
-h, --help Display this message
-V, --version Print version info and exit
--list List installed commands
+ --explain CODE Run `rustc --explain CODE`
-v, --verbose Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
return Ok(None)
}
+ if let Some(ref code) = flags.flag_explain {
+ try!(process(config.rustc()).arg("--explain").arg(code).exec()
+ .map_err(human));
+ return Ok(None)
+ }
+
let args = match &flags.arg_command[..] {
// For the commands `cargo` and `cargo help`, re-execute ourselves as
// `cargo -h` so we can go through the normal process of printing the