Skip to main content

frame_cli/commands/
dispatch.rs

1//! Routes a parsed command line to its verb.
2
3use crate::cli::{Cli, Command};
4use crate::error::CliError;
5
6/// Executes a parsed CLI command.
7///
8/// # Errors
9///
10/// Returns the verb's typed refusal or failure.
11pub fn execute(cli: Cli) -> Result<(), CliError> {
12    match cli.command {
13        Command::New { name } => super::new::new(&name),
14        Command::Run => super::run::run(),
15        Command::Dev { quiet_ms } => super::dev::dev(quiet_ms),
16        Command::Test(scope) => super::test::test(scope),
17        Command::Check => super::check::check(),
18        Command::Doctor => super::doctor::doctor(),
19        Command::Build => super::build::build(),
20        Command::Host { config } => super::host::host(&config),
21    }
22}