use std::{process, env};
use mini_grep::grep;
fn main() {
let config = grep::Config::new(env::args()).unwrap_or_else(|err| {
eprintln!("ERROR: {}", err);
process::exit(1);
});
let content = grep::run(&config).unwrap_or_else(|err| {
eprintln!("ERROR: {}", err);
process::exit(1);
});
let result = grep::search(&config.keyword, &content, config.ignore_case);
for item in result {
println!("{}", item);
}
}
I'm nobody! Who are you?
Are you nobody, too?
Then there's a pair of us - don't tell!
They'd banish us, you know.
How dreary to be somebody!
How public, like a frog
To tell your name the livelong day
To an admiring bog!