use std::process::ExitCode;
use clap::{Args, Subcommand};
use crate::config::ResolvedContext;
use crate::output::OutputFormat;
pub mod approve;
pub mod client;
pub mod get;
pub mod list;
pub mod models;
pub mod reason_io;
pub mod reject;
pub mod watch;
#[derive(Debug, Subcommand)]
pub enum ApprovalsSubcommand {
List(list::ListArgs),
Get(get::GetArgs),
Approve(approve::ApproveArgs),
Reject(reject::RejectArgs),
Watch(watch::WatchArgs),
}
#[derive(Debug, Args)]
pub struct ApprovalsArgs {
#[command(subcommand)]
pub command: ApprovalsSubcommand,
}
pub fn dispatch(args: ApprovalsArgs, ctx: &ResolvedContext, global_output: OutputFormat) -> ExitCode {
match args.command {
ApprovalsSubcommand::List(a) => list::run_list(a, ctx, global_output),
ApprovalsSubcommand::Get(a) => get::run_get(a, ctx, global_output),
ApprovalsSubcommand::Approve(a) => approve::run_approve(a, ctx),
ApprovalsSubcommand::Reject(a) => reject::run_reject(a, ctx),
ApprovalsSubcommand::Watch(a) => watch::run_watch(a, ctx),
}
}