//! Command-line argument parsing definitions.

use clap::{Parser, Subcommand};

/// Trust Systems CLI — Minimal C2PA manifest injection and verification.
#[derive(Parser, Debug)]
#[command(name = "trust-systems")]
#[command(about = "Truth-as-a-Service: inject and verify C2PA manifests in JPEG images")]
pub struct Cli {
    #[command(subcommand)]
    pub command: Command, // Made required so the CLI prompts the user if they forget a subcommand
}

#[derive(Subcommand, Debug)]
pub enum Command {
    /// Injects a standard C2PA manifest into a target image using a certificate chain
    Sign {
        /// Path to the source JPEG
        #[arg(short, long)]
        input: String,

        /// Path where the signed JPEG will be saved
        #[arg(short, long)]
        output: String,

        /// Path to the X.509 certificate file (PEM format)
        #[arg(short, long)]
        cert: String,

        /// Path to the private key file (PEM format)
        #[arg(short, long)]
        key: String,

        /// Author's name for the manifest assertion
        #[arg(short, long)]
        author: String,
    },

    /// Reads a signed image and validates its C2PA manifest
    Verify {
        /// Path to the signed JPEG
        #[arg(short, long)]
        input: String,
    },
}

/// Parse command-line arguments.
pub fn parse() -> Cli {
    Cli::parse()
}
