提交 58e2083c 编写于 作者: B Brian Anderson

rustdoc: Parse command line opts

上级 6c9527ab
......@@ -93,20 +93,22 @@ fn pass2(
}
}
fn main(argv: [str]) {
fn main(args: [str]) {
if vec::contains(argv, "-h") {
if vec::contains(args, "-h") {
config::usage();
ret;
}
if vec::len(argv) != 2u {
std::io::println(#fmt("usage: %s <input>", argv[0]));
let config = alt config::parse_config(args) {
result::ok(config) { config }
result::err(err) {
std::io::println(#fmt("error: %s", err));
ret;
}
}
};
let source_file = argv[1];
run(source_file);
run(config.input_crate);
}
fn time<T>(what: str, f: fn() -> T) -> T {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册