use std::io;
use std::path::PathBuf;
use clap::Parser;
use domain_checker_lite::run;

#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
struct Args {
    /// Path of domain file to use
    #[arg(short, long, default_value = "./domains.txt")]
    domain_file: PathBuf,
}

fn main() {
    let args = Args::parse();

    // Returns a Vector of Domain structs, parsed from a config file
    let conf = run(args.domain_file);

    // Prints the results
    for dom in conf {
        println!("{dom}");
    }

    println!("\r\nHit the any key to exit!");

    if cfg!(not(debug_assertions)) {
        io::stdin().read_line(&mut String::new()).unwrap();
    }
}

