use std::fmt::Debug;
use std::process::exit;

use argh::FromArgs;

use crate::parsing::HostsFile;

/// Validate all entries
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "validate")]
pub struct Args {}

pub fn main(_: &Args) {
    let hosts_file = HostsFile::load();
    if hosts_file.is_dirty {
        println!("Hosts file is dirty.");
        exit(1)
    }

    println!("Hosts file is clean.");
}
