Exit cleanly on opt parse fail

This commit is contained in:
greg 2017-01-09 22:56:29 -08:00
parent 1631bb0a04
commit 7ddb421ced

View File

@ -23,7 +23,13 @@ mod llvm_wrap;
fn main() { fn main() {
let option_matches = 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"); let trace = option_matches.opt_present("t");
match option_matches.free[..] { match option_matches.free[..] {
[] | [_] => { [] | [_] => {