rustdoc: Get --version working

Closes #11421
This commit is contained in:
Alex Crichton 2014-01-10 10:05:26 -08:00
parent b1eaeb5561
commit 79e144ed64

View File

@ -83,6 +83,7 @@ pub fn opts() -> ~[groups::OptGroup] {
use extra::getopts::groups::*;
~[
optflag("h", "help", "show this help message"),
optflag("", "version", "print rustdoc's version"),
optopt("r", "input-format", "the input type of the specified file",
"[rust|json]"),
optopt("w", "output-format", "the output type to write",
@ -119,6 +120,9 @@ pub fn main_args(args: &[~str]) -> int {
if matches.opt_present("h") || matches.opt_present("help") {
usage(args[0]);
return 0;
} else if matches.opt_present("version") {
rustc::version(args[0]);
return 0;
}
if matches.free.len() == 0 {