Skip to content

Fix rustdoc --passes list #15888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,18 @@ pub fn main_args(args: &[String]) -> int {
}
}

if matches.opt_strs("passes").as_slice() == &["list".to_string()] {
println!("Available passes for running rustdoc:");
for &(name, _, description) in PASSES.iter() {
println!("{:>20s} - {}", name, description);
}
println!("{}", "\nDefault passes for rustdoc:"); // FIXME: #9970
for &name in DEFAULT_PASSES.iter() {
println!("{:>20s}", name);
}
return 0;
}

if matches.free.len() == 0 {
println!("expected an input file to act on");
return 1;
Expand Down Expand Up @@ -212,18 +224,6 @@ pub fn main_args(args: &[String]) -> int {
(false, false) => {}
}

if matches.opt_strs("passes").as_slice() == &["list".to_string()] {
println!("Available passes for running rustdoc:");
for &(name, _, description) in PASSES.iter() {
println!("{:>20s} - {}", name, description);
}
println!("{}", "\nDefault passes for rustdoc:"); // FIXME: #9970
for &name in DEFAULT_PASSES.iter() {
println!("{:>20s}", name);
}
return 0;
}

let (krate, res) = match acquire_input(input, externs, &matches) {
Ok(pair) => pair,
Err(s) => {
Expand Down