@@ -50,20 +50,20 @@ pub fn main() {
5050
5151pub fn parse_config(args: ~[~str]) -> config {
5252 let opts =
53- ~[getopts::reqopt(~ "compile-lib-path"),
54- getopts::reqopt(~ "run-lib-path"),
55- getopts::reqopt(~ "rustc-path"), getopts::reqopt(~ "src-base"),
56- getopts::reqopt(~ "build-base"), getopts::reqopt(~ "aux-base"),
57- getopts::reqopt(~ "stage-id"),
58- getopts::reqopt(~ "mode"), getopts::optflag(~ "ignored"),
59- getopts::optopt(~ "runtool"), getopts::optopt(~ "rustcflags"),
60- getopts::optflag(~ "verbose"),
61- getopts::optopt(~ "logfile"),
62- getopts::optflag(~ "jit"),
63- getopts::optflag(~ "newrt"),
64- getopts::optopt(~ "target"),
65- getopts::optopt(~ "adb-path"),
66- getopts::optopt(~ "adb-test-dir")
53+ ~[getopts::reqopt("compile-lib-path"),
54+ getopts::reqopt("run-lib-path"),
55+ getopts::reqopt("rustc-path"), getopts::reqopt("src-base"),
56+ getopts::reqopt("build-base"), getopts::reqopt("aux-base"),
57+ getopts::reqopt("stage-id"),
58+ getopts::reqopt("mode"), getopts::optflag("ignored"),
59+ getopts::optopt("runtool"), getopts::optopt("rustcflags"),
60+ getopts::optflag("verbose"),
61+ getopts::optopt("logfile"),
62+ getopts::optflag("jit"),
63+ getopts::optflag("newrt"),
64+ getopts::optopt("target"),
65+ getopts::optopt("adb-path"),
66+ getopts::optopt("adb-test-dir")
6767 ];
6868
6969 assert!(!args.is_empty());
@@ -74,43 +74,43 @@ pub fn parse_config(args: ~[~str]) -> config {
7474 Err(f) => fail!(getopts::fail_str(f))
7575 };
7676
77- fn opt_path(m: &getopts::Matches, nm: ~ str) -> Path {
77+ fn opt_path(m: &getopts::Matches, nm: & str) -> Path {
7878 Path(getopts::opt_str(m, nm))
7979 }
8080
8181 config {
82- compile_lib_path: getopts::opt_str(matches, ~ "compile-lib-path"),
83- run_lib_path: getopts::opt_str(matches, ~ "run-lib-path"),
84- rustc_path: opt_path(matches, ~ "rustc-path"),
85- src_base: opt_path(matches, ~ "src-base"),
86- build_base: opt_path(matches, ~ "build-base"),
87- aux_base: opt_path(matches, ~ "aux-base"),
88- stage_id: getopts::opt_str(matches, ~ "stage-id"),
89- mode: str_mode(getopts::opt_str(matches, ~ "mode")),
90- run_ignored: getopts::opt_present(matches, ~ "ignored"),
82+ compile_lib_path: getopts::opt_str(matches, "compile-lib-path"),
83+ run_lib_path: getopts::opt_str(matches, "run-lib-path"),
84+ rustc_path: opt_path(matches, "rustc-path"),
85+ src_base: opt_path(matches, "src-base"),
86+ build_base: opt_path(matches, "build-base"),
87+ aux_base: opt_path(matches, "aux-base"),
88+ stage_id: getopts::opt_str(matches, "stage-id"),
89+ mode: str_mode(getopts::opt_str(matches, "mode")),
90+ run_ignored: getopts::opt_present(matches, "ignored"),
9191 filter:
9292 if vec::len(matches.free) > 0u {
9393 option::Some(copy matches.free[0])
9494 } else { option::None },
95- logfile: getopts::opt_maybe_str(matches, ~ "logfile").map(|s| Path(*s)),
96- runtool: getopts::opt_maybe_str(matches, ~ "runtool"),
97- rustcflags: getopts::opt_maybe_str(matches, ~ "rustcflags"),
98- jit: getopts::opt_present(matches, ~ "jit"),
99- newrt: getopts::opt_present(matches, ~ "newrt"),
100- target: opt_str2(getopts::opt_maybe_str(matches, ~ "target")).to_str(),
101- adb_path: opt_str2(getopts::opt_maybe_str(matches, ~ "adb-path")).to_str(),
95+ logfile: getopts::opt_maybe_str(matches, "logfile").map(|s| Path(*s)),
96+ runtool: getopts::opt_maybe_str(matches, "runtool"),
97+ rustcflags: getopts::opt_maybe_str(matches, "rustcflags"),
98+ jit: getopts::opt_present(matches, "jit"),
99+ newrt: getopts::opt_present(matches, "newrt"),
100+ target: opt_str2(getopts::opt_maybe_str(matches, "target")).to_str(),
101+ adb_path: opt_str2(getopts::opt_maybe_str(matches, "adb-path")).to_str(),
102102 adb_test_dir:
103- opt_str2(getopts::opt_maybe_str(matches, ~ "adb-test-dir")).to_str(),
103+ opt_str2(getopts::opt_maybe_str(matches, "adb-test-dir")).to_str(),
104104 adb_device_status:
105- if (opt_str2(getopts::opt_maybe_str(matches, ~ "target")) ==
105+ if (opt_str2(getopts::opt_maybe_str(matches, "target")) ==
106106 ~"arm-linux-androideabi") {
107- if (opt_str2(getopts::opt_maybe_str(matches, ~ "adb-test-dir")) !=
107+ if (opt_str2(getopts::opt_maybe_str(matches, "adb-test-dir")) !=
108108 ~"(none)" &&
109- opt_str2(getopts::opt_maybe_str(matches, ~ "adb-test-dir")) !=
109+ opt_str2(getopts::opt_maybe_str(matches, "adb-test-dir")) !=
110110 ~"") { true }
111111 else { false }
112112 } else { false },
113- verbose: getopts::opt_present(matches, ~ "verbose")
113+ verbose: getopts::opt_present(matches, "verbose")
114114 }
115115}
116116
0 commit comments