Fix rustdoc -Zhelp and -Chelp options

This commit is contained in:
Guillaume Gomez 2022-07-08 15:37:44 +02:00
parent a51fb2ba82
commit 992346d7bd

View File

@ -329,6 +329,17 @@ pub(crate) fn from_matches(
return Err(0);
}
let z_flags = matches.opt_strs("Z");
if z_flags.iter().any(|x| *x == "help") {
print_flag_list("-Z", config::DB_OPTIONS);
return Err(0);
}
let c_flags = matches.opt_strs("C");
if c_flags.iter().any(|x| *x == "help") {
print_flag_list("-C", config::CG_OPTIONS);
return Err(0);
}
let color = config::parse_color(matches);
let config::JsonConfig { json_rendered, json_unused_externs, .. } =
config::parse_json(matches);
@ -343,17 +354,6 @@ pub(crate) fn from_matches(
// check for deprecated options
check_deprecated_options(matches, &diag);
let z_flags = matches.opt_strs("Z");
if z_flags.iter().any(|x| *x == "help") {
print_flag_list("-Z", config::DB_OPTIONS);
return Err(0);
}
let c_flags = matches.opt_strs("C");
if c_flags.iter().any(|x| *x == "help") {
print_flag_list("-C", config::CG_OPTIONS);
return Err(0);
}
if matches.opt_strs("passes") == ["list"] {
println!("Available passes for running rustdoc:");
for pass in passes::PASSES {