mod delete;
mod format;
mod history;
mod list;
mod show;
use clap::{Args, Subcommand, ValueEnum};
use crate::Result;
#[derive(Args, Debug)]
pub struct ReleaseArgs {
#[command(subcommand)]
pub command: ReleaseSubcommand,
}
#[derive(Subcommand, Debug)]
pub enum ReleaseSubcommand {
List(list::ListArgs),
Show(show::ShowArgs),
History(history::HistoryArgs),
Delete(delete::DeleteArgs),
}
#[derive(Debug, Clone, Copy, ValueEnum)]
pub enum OutputFormat {
Table,
Json,
Yaml,
Wide,
}
impl Default for OutputFormat {
fn default() -> Self {
Self::Table
}
}
#[derive(Debug, Clone, Copy, ValueEnum)]
pub enum SortBy {
Name,
Namespace,
Revision,
Age,
}
impl Default for SortBy {
fn default() -> Self {
Self::Name
}
}
pub async fn execute(args: ReleaseArgs) -> Result<()> {
match args.command {
ReleaseSubcommand::List(args) => list::execute(args).await,
ReleaseSubcommand::Show(args) => show::execute(args).await,
ReleaseSubcommand::History(args) => history::execute(args).await,
ReleaseSubcommand::Delete(args) => delete::execute(args).await,
}
}