//! The `voa verify` subcommand.

use clap::Parser;
use voa_core::identifiers::{Context, Os, Technology};

use crate::{
    cli::OutputFormat,
    utils::{ArtifactVerifierPurpose, RegularFile},
};

#[derive(Debug, Parser)]
pub struct VerifyCommand {
    #[arg(env = "VOA_VERIFY_OS", help = "The OS to verify for.")]
    pub os: Os,

    #[arg(env = "VOA_VERIFY_PURPOSE", help = "The purpose to verify for.")]
    pub purpose: ArtifactVerifierPurpose,

    #[arg(env = "VOA_VERIFY_CONTEXT", help = "The context to verify for.")]
    pub context: Context,

    #[arg(
        env = "VOA_VERIFY_TECHNOLOGY",
        help = "The technology to verify with.",
        long_help = r#"The technology to verify with.

Currently only "openpgp" is supported."#
    )]
    pub technology: Technology,

    #[arg(env = "VOA_VERIFY_FILE", help = "The file to verify.")]
    pub file: RegularFile,

    #[arg(
        env = "VOA_VERIFY_SIGNATURE",
        help = "The signature to verify a file with."
    )]
    pub signatures: Vec<RegularFile>,

    #[arg(
        env = "VOA_VERIFY_OUTPUT_FORMAT",
        help = "The output format to use.",
        long,
        short,
        default_value_t = OutputFormat::default()
    )]
    pub output_format: OutputFormat,
}
