Skip to content

Commit 5d3aaa8

Browse files
committed
auto merge of rust-lang#15888 : mprobinson/rust/rustdoc-fixes, r=cmr
Allow "rustdoc --passes list" to work without specifying input files, as shown in the examples section of the man page.
2 parents 915fb2b + 6d3a623 commit 5d3aaa8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/librustdoc/lib.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,18 @@ pub fn main_args(args: &[String]) -> int {
162162
}
163163
}
164164

165+
if matches.opt_strs("passes").as_slice() == &["list".to_string()] {
166+
println!("Available passes for running rustdoc:");
167+
for &(name, _, description) in PASSES.iter() {
168+
println!("{:>20s} - {}", name, description);
169+
}
170+
println!("{}", "\nDefault passes for rustdoc:"); // FIXME: #9970
171+
for &name in DEFAULT_PASSES.iter() {
172+
println!("{:>20s}", name);
173+
}
174+
return 0;
175+
}
176+
165177
if matches.free.len() == 0 {
166178
println!("expected an input file to act on");
167179
return 1;
@@ -212,18 +224,6 @@ pub fn main_args(args: &[String]) -> int {
212224
(false, false) => {}
213225
}
214226

215-
if matches.opt_strs("passes").as_slice() == &["list".to_string()] {
216-
println!("Available passes for running rustdoc:");
217-
for &(name, _, description) in PASSES.iter() {
218-
println!("{:>20s} - {}", name, description);
219-
}
220-
println!("{}", "\nDefault passes for rustdoc:"); // FIXME: #9970
221-
for &name in DEFAULT_PASSES.iter() {
222-
println!("{:>20s}", name);
223-
}
224-
return 0;
225-
}
226-
227227
let (krate, res) = match acquire_input(input, externs, &matches) {
228228
Ok(pair) => pair,
229229
Err(s) => {

0 commit comments

Comments
 (0)