Skip to content

Commit 1e8e7dc

Browse files
committed
improve compiletest error message when path option missing.
(I often run `compiletest` by hand by cut-and-pasting from what `make` runs, but then I need to tweak it (cut out options) and its useful to be told when I have removed an option that is actually required, such as `--android-cross-path=path`.)
1 parent 189930f commit 1e8e7dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiletest/compiletest.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ pub fn parse_config(args: Vec<String> ) -> Config {
118118
}
119119

120120
fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
121-
Path::new(m.opt_str(nm).unwrap())
121+
match m.opt_str(nm) {
122+
Some(s) => Path::new(s),
123+
None => panic!("no option (=path) found for {}", nm),
124+
}
122125
}
123126

124127
let filter = if !matches.free.is_empty() {

0 commit comments

Comments
 (0)