use std::env;
use std::process;

fn main() {
    let config = nader::Config::build(env::args()).unwrap_or_else(|err| {
        eprintln!("Couldn't parse args: {err}");
        process::exit(1);
    });
    println!("Searching for {} in file {}\n", config.query, config.filepath);

    if let Err(err) = nader::run(config) {
        eprintln!("Error running: {err:?}");
        process::exit(1);
    }
}