Skip to content

Commit c5dde23

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 9054273 commit c5dde23

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiletest/compiletest.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ pub fn parse_config(args: Vec<String> ) -> Config {
116116
}
117117

118118
fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
119-
Path::new(m.opt_str(nm).unwrap())
119+
match m.opt_str(nm) {
120+
Some(s) => Path::new(s),
121+
None => panic!("no option (=path) found for {}", nm),
122+
}
120123
}
121124

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

0 commit comments

Comments
 (0)