use std::env;
use std::fs;
use std::process;
use std::error::Error;
use LCPminigrep::Config;
fn main() {
let args: Vec<String> = env::args().collect();
println!("参数 {:?}", args);
let config = Config::new(env::args()).unwrap_or_else(|err|{
println!("Problmen parsing arguments: {}",err);
process::exit(1);
});
println!("Searching for {}", config.query);
println!("In file {}", config.filename);
if let Err(e)=LCPminigrep::run(config){
println!("Application error:{}",e);
process::exit(1);
}
}