use clap::{Args, Parser, Subcommand};
#[derive(Debug, Parser)]
#[command(version, about, long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Command,
}
#[derive(Debug, Subcommand)]
pub enum Command {
#[command(name = "install")]
Install(InstallArgs),
#[command(name = "update")]
Update,
#[command(name = "upgrade")]
Upgrade(UpgradeArgs),
#[command(name = "remove")]
Remove(RemoveArgs),
#[command(name = "search")]
Search(SearchArgs),
#[command(name = "appimage", aliases = ["a", "ai"])]
AppImage {
#[command(subcommand)]
action: zap_rs::Command,
},
#[command(name = "repo")]
Repo,
}
#[derive(Debug, Args)]
pub struct InstallArgs {
pub packages: Vec<String>,
#[arg(long, short = 'y', default_value_t = false)]
pub yes: bool,
}
#[derive(Debug, Args)]
pub struct UpgradeArgs {
pub packages: Vec<String>,
#[arg(long, short = 'y', default_value_t = false)]
pub yes: bool,
}
#[derive(Debug, Args)]
pub struct RemoveArgs {
pub packages: Vec<String>,
#[arg(long, short = 'y', default_value_t = false)]
pub yes: bool,
}
#[derive(Debug, Args)]
pub struct SearchArgs {
pub package: String,
}