1pub mod build;
2pub mod log;
3pub mod new;
4pub mod run;
5
6use crate::error::Result;
7use clap::Clap;
8use creator_tools::utils::Config;
9
10#[derive(Clap, Clone, Debug)]
11pub enum Commands {
12 Build(build::BuildCommand),
14 Run(run::RunCommand),
16 New(new::NewCommand),
18 Log(log::LogCommand),
20}
21
22impl Commands {
23 pub fn handle_command(&self, config: &Config) -> Result<()> {
24 match self {
25 Commands::Build(cmd) => cmd.handle_command(config),
26 Commands::Run(cmd) => cmd.handle_command(config),
27 Commands::New(cmd) => cmd.handle_command(config),
28 Commands::Log(cmd) => cmd.handle_command(config),
29 }
30 }
31}