soroban_cli/commands/container/
mod.rs1use crate::commands::global;
2
3pub(crate) mod logs;
4mod shared;
5pub(crate) mod start;
6pub(crate) mod stop;
7
8pub type StartCmd = start::Cmd;
10pub type StopCmd = stop::Cmd;
12
13#[derive(Debug, clap::Subcommand)]
14pub enum Cmd {
15 Logs(logs::Cmd),
17 Start(start::Cmd),
25 Stop(stop::Cmd),
27}
28
29#[derive(thiserror::Error, Debug)]
30pub enum Error {
31 #[error(transparent)]
32 Logs(#[from] logs::Error),
33
34 #[error(transparent)]
35 Start(#[from] start::Error),
36
37 #[error(transparent)]
38 Stop(#[from] stop::Error),
39}
40
41impl Cmd {
42 pub async fn run(&self, global_args: &global::Args) -> Result<(), Error> {
43 match &self {
44 Cmd::Logs(cmd) => cmd.run(global_args).await?,
45 Cmd::Start(cmd) => cmd.run(global_args).await?,
46 Cmd::Stop(cmd) => cmd.run(global_args).await?,
47 }
48 Ok(())
49 }
50}