use std::path::PathBuf;
use alpm_types::Architecture;
use clap::{Parser, Subcommand};
#[derive(Clone, Debug, Parser)]
#[command(about, author, name = "alpm-srcinfo", version)]
pub struct Cli {
#[command(subcommand)]
pub command: Command,
}
#[derive(Clone, Debug, Default, clap::ValueEnum, strum::Display)]
pub enum OutputFormat {
#[default]
#[strum(serialize = "json")]
Json,
}
#[derive(Clone, Debug, Subcommand)]
pub enum Command {
#[command()]
Validate {
#[arg(value_name = "FILE")]
file: Option<PathBuf>,
},
#[command()]
FormatPackages {
#[arg(value_name = "FILE")]
file: Option<PathBuf>,
#[arg(short, long, alias = "arch")]
architecture: Architecture,
#[arg(
short,
long,
value_name = "OUTPUT_FORMAT",
default_value_t = OutputFormat::Json
)]
output_format: OutputFormat,
#[arg(short, long)]
pretty: bool,
},
#[command()]
Check {
#[arg(value_name = "FILE")]
file: Option<PathBuf>,
},
}