diff options
| author | Mike Robinson <mikeprobinsonuk@gmail.com> | 2014-07-21 23:37:04 +0100 |
|---|---|---|
| committer | Mike Robinson <mikeprobinsonuk@gmail.com> | 2014-07-21 23:37:04 +0100 |
| commit | 6d3a623cc829a9b37a0df00e8087cc245f7e188c (patch) | |
| tree | 337e4604b038ccfa1b7923767cacfcc88e2cfde3 | |
| parent | df68c6f3c35354662b39128d56d5dcc6deadf591 (diff) | |
| download | rust-6d3a623cc829a9b37a0df00e8087cc245f7e188c.tar.gz rust-6d3a623cc829a9b37a0df00e8087cc245f7e188c.zip | |
Fix rustdoc --passes list
Allow "rustdoc --passes list" to work without specifying input files, as shown in the examples section of the man page.
| -rw-r--r-- | src/librustdoc/lib.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index a7c9ac10118..76b3a012dbf 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -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; @@ -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) => { |
