use clap::{Args, Parser, Subcommand};
#[derive(Parser, Debug)]
#[command(
name = "confium",
version,
about = "Confium trust store framework",
long_about = "Confium trust store framework — install and manage cryptographic plugins.",
propagate_version = true
)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand, Debug)]
pub enum Commands {
Install(InstallArgs),
Remove(RemoveArgs),
Update(UpdateArgs),
List(ListArgs),
Info(InfoArgs),
Search(SearchArgs),
Trust(TrustArgs),
Config(ConfigArgs),
Version,
}
#[derive(Args, Debug)]
pub struct InstallArgs {
pub plugin: String,
}
#[derive(Args, Debug)]
pub struct RemoveArgs {
pub plugin: String,
}
#[derive(Args, Debug)]
pub struct UpdateArgs {
pub plugin: Option<String>,
}
#[derive(Args, Debug)]
pub struct ListArgs {}
#[derive(Args, Debug)]
pub struct InfoArgs {
pub plugin: String,
}
#[derive(Args, Debug)]
pub struct SearchArgs {
pub interface: Option<String>,
pub algorithm: Option<String>,
}
#[derive(Args, Debug)]
pub struct TrustArgs {
#[command(subcommand)]
pub action: TrustAction,
}
#[derive(Subcommand, Debug)]
pub enum TrustAction {
List,
Add(TrustAddArgs),
Remove(TrustRemoveArgs),
}
#[derive(Args, Debug)]
pub struct TrustAddArgs {
pub publisher: String,
#[arg(long)]
pub key: Option<String>,
}
#[derive(Args, Debug)]
pub struct TrustRemoveArgs {
pub publisher: String,
}
#[derive(Args, Debug)]
pub struct ConfigArgs {
#[command(subcommand)]
pub action: ConfigAction,
}
#[derive(Subcommand, Debug)]
pub enum ConfigAction {
Edit,
Show,
Set(ConfigSetArgs),
Get(ConfigGetArgs),
}
#[derive(Args, Debug)]
pub struct ConfigSetArgs {
pub key: String,
pub value: String,
}
#[derive(Args, Debug)]
pub struct ConfigGetArgs {
pub key: String,
}