use clap::Parser;
use miette::{miette, Result};
mod list_themes;
mod new;
mod run;
mod validate;
use list_themes::ListThemes;
use new::New;
use run::Run;
use validate::Validate;
#[derive(Debug, Parser)]
pub enum Command {
New(New),
Publish,
Record,
Run(Run),
Serve,
Themes(ListThemes),
Validate(Validate),
}
impl Command {
pub fn run(&self) -> Result<()> {
match self {
Command::New(command) => command.run()?,
Command::Publish => return Err(miette!("publish is intentionally not implemented")),
Command::Record => return Err(miette!("record is intentionally not implemented")),
Command::Run(command) => command.run()?,
Command::Serve => return Err(miette!("serve is intentionally not implemented")),
Command::Themes(command) => command.run()?,
Command::Validate(command) => command.run()?,
}
Ok(())
}
}