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