Exit cleanly on opt parse fail

This commit is contained in:
greg 2017-01-09 22:56:29 -08:00
parent 1631bb0a04
commit 7ddb421ced
1 changed files with 7 additions and 1 deletions

View File

@ -23,7 +23,13 @@ mod llvm_wrap;
fn main() {
let option_matches =
program_options().parse(std::env::args()).expect("Could not parse options");
match program_options().parse(std::env::args()) {
Ok(o) => o,
Err(e) => {
println!("{:?}", e);
std::process::exit(1);
}
};
let trace = option_matches.opt_present("t");
match option_matches.free[..] {
[] | [_] => {