Exit cleanly on opt parse fail
This commit is contained in:
parent
1631bb0a04
commit
7ddb421ced
@ -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[..] {
|
||||
[] | [_] => {
|
||||
|
Loading…
Reference in New Issue
Block a user