use std::path::PathBuf;
use argp::FromArgs;
use crate::util::{redump, shared::convert_and_verify};
#[derive(FromArgs, Debug)]
#[argp(subcommand, name = "verify")]
pub struct Args {
#[argp(positional)]
file: Vec<PathBuf>,
#[argp(switch)]
md5: bool,
#[argp(option, short = 'd')]
dat: Vec<PathBuf>,
}
pub fn run(args: Args) -> nod::Result<()> {
if !args.dat.is_empty() {
println!("Loading dat files...");
redump::load_dats(args.dat.iter().map(PathBuf::as_ref))?;
}
for file in &args.file {
convert_and_verify(file, None, args.md5)?;
println!();
}
Ok(())
}