//! Trust Systems CLI — entry point.

mod cli;

use anyhow::Result;
use trust_systems::c2pa_core;

fn main() -> Result<()> {
    let args = cli::parse();

    match args.command {
        cli::Command::Sign {
            input,
            output,
            cert,
            key,
            author,
        } => {
            println!(
                "Signing '{}' -> '{}' using cert '{}'...",
                input, output, cert
            );
            c2pa_core::sign_image(&input, &output, &cert, &key, &author)?;
            println!("Success: Manifest injected.");
        }
        cli::Command::Verify { input } => {
            let result = c2pa_core::verify_image(&input)?;
            println!("Validation status: {}", result.status);
            println!("Author: {}", result.author.as_deref().unwrap_or("(none)"));
        }
    }

    Ok(())
}
