]>
Commit | Line | Data |
---|---|---|
74b04a01 XL |
1 | use std::env; |
2 | use std::process; | |
3 | ||
4 | use minigrep::Config; | |
5 | ||
6 | fn main() { | |
7 | let config = Config::new(env::args()).unwrap_or_else(|err| { | |
8 | eprintln!("Problem parsing arguments: {}", err); | |
9 | process::exit(1); | |
10 | }); | |
11 | ||
12 | if let Err(e) = minigrep::run(config) { | |
13 | eprintln!("Application error: {}", e); | |
14 | ||
15 | process::exit(1); | |
16 | } | |
17 | } |