@@ -50,20 +50,20 @@ pub fn main() {
50
50
51
51
pub fn parse_config(args: ~[~str]) -> config {
52
52
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")
67
67
];
68
68
69
69
assert!(!args.is_empty());
@@ -74,43 +74,43 @@ pub fn parse_config(args: ~[~str]) -> config {
74
74
Err(f) => fail!(getopts::fail_str(f))
75
75
};
76
76
77
- fn opt_path(m: &getopts::Matches, nm: ~ str) -> Path {
77
+ fn opt_path(m: &getopts::Matches, nm: & str) -> Path {
78
78
Path(getopts::opt_str(m, nm))
79
79
}
80
80
81
81
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"),
91
91
filter:
92
92
if vec::len(matches.free) > 0u {
93
93
option::Some(copy matches.free[0])
94
94
} 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(),
102
102
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(),
104
104
adb_device_status:
105
- if (opt_str2(getopts::opt_maybe_str(matches, ~ "target")) ==
105
+ if (opt_str2(getopts::opt_maybe_str(matches, "target")) ==
106
106
~"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")) !=
108
108
~"(none)" &&
109
- opt_str2(getopts::opt_maybe_str(matches, ~ "adb-test-dir")) !=
109
+ opt_str2(getopts::opt_maybe_str(matches, "adb-test-dir")) !=
110
110
~"") { true }
111
111
else { false }
112
112
} else { false },
113
- verbose: getopts::opt_present(matches, ~ "verbose")
113
+ verbose: getopts::opt_present(matches, "verbose")
114
114
}
115
115
}
116
116
0 commit comments