Skip to main content

deslicer_cli/commands/change/
mod.rs

1use clap::Subcommand;
2
3use crate::Ctx;
4
5pub mod approve;
6pub mod deploy;
7pub mod plan;
8pub mod reject;
9pub mod show;
10pub mod status;
11pub mod verify;
12
13#[derive(Subcommand)]
14pub enum ChangeCmd {
15    Plan(plan::Args),
16    Show(show::Args),
17    Approve(approve::Args),
18    Reject(reject::Args),
19    Deploy(deploy::Args),
20    Verify(verify::Args),
21    Status(status::Args),
22}
23
24pub async fn dispatch(ctx: Ctx, cmd: ChangeCmd) -> i32 {
25    match cmd {
26        ChangeCmd::Plan(args) => plan::run(ctx, args).await,
27        ChangeCmd::Show(args) => show::run(ctx, args).await,
28        ChangeCmd::Approve(args) => approve::run(ctx, args).await,
29        ChangeCmd::Reject(args) => reject::run(ctx, args).await,
30        ChangeCmd::Deploy(args) => deploy::run(ctx, args).await,
31        ChangeCmd::Verify(args) => verify::run(ctx, args).await,
32        ChangeCmd::Status(args) => status::run(ctx, args).await,
33    }
34}