Fix rustdoc --passes list
Allow "rustdoc --passes list" to work without specifying input files, as shown in the examples section of the man page.
This commit is contained in:
parent
df68c6f3c3
commit
6d3a623cc8
1 changed files with 12 additions and 12 deletions
|
@ -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 {
|
if matches.free.len() == 0 {
|
||||||
println!("expected an input file to act on");
|
println!("expected an input file to act on");
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -212,18 +224,6 @@ pub fn main_args(args: &[String]) -> int {
|
||||||
(false, false) => {}
|
(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) {
|
let (krate, res) = match acquire_input(input, externs, &matches) {
|
||||||
Ok(pair) => pair,
|
Ok(pair) => pair,
|
||||||
Err(s) => {
|
Err(s) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue