blob: fc5ae9a9ccb76fd1163a1ffcccd6ac5d4a2b58d2 (
plain) (
tree)
|
|
use std::process;
use std::env;
use minigrep;
use minigrep::Config;
fn main() {
let args: Vec<String> = env::args().collect();
let config = Config::new(&args).unwrap_or_else(|err| {
println!("Problem parsing arguments: {}", err);
process::exit(1);
});
println!("\nSearching for {}", config.query);
println!(" in file {}", config.filename);
if let Err(e) = minigrep::run(config) {
println!("Application error: {}", e);
process::exit(1);
}
}
|