rustdoc: Parse command line opts
This commit is contained in:
@@ -93,20 +93,22 @@ fn test_run_passes() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main(argv: [str]) {
|
fn main(args: [str]) {
|
||||||
|
|
||||||
if vec::contains(argv, "-h") {
|
if vec::contains(args, "-h") {
|
||||||
config::usage();
|
config::usage();
|
||||||
ret;
|
ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if vec::len(argv) != 2u {
|
let config = alt config::parse_config(args) {
|
||||||
std::io::println(#fmt("usage: %s <input>", argv[0]));
|
result::ok(config) { config }
|
||||||
|
result::err(err) {
|
||||||
|
std::io::println(#fmt("error: %s", err));
|
||||||
ret;
|
ret;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let source_file = argv[1];
|
run(config.input_crate);
|
||||||
run(source_file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn time<T>(what: str, f: fn() -> T) -> T {
|
fn time<T>(what: str, f: fn() -> T) -> T {
|
||||||
|
|||||||
Reference in New Issue
Block a user