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", alias = "i")]
Install(InstallArgs),
#[command(name = "update", alias = "u")]
Update(UpdateArgs),
#[command(name = "remove", alias = "rm")]
Remove(RemoveArgs),
#[command(name = "list", alias = "ls")]
List,
}
#[derive(Debug, Args)]
pub struct InstallArgs {
pub appname: String,
#[arg(long)]
pub from: String,
#[arg(long)]
pub executable: Option<String>,
#[arg(long, default_value_t = false)]
pub github: bool,
}
#[derive(Debug, Args)]
pub struct UpdateArgs {
pub appname: String,
}
#[derive(Debug, Args)]
pub struct RemoveArgs {
pub appname: String,
}