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::Test(scope) => super::test::test(scope),
16        Command::Check => super::check::check(),
17        Command::Doctor => super::doctor::doctor(),
18        Command::Build => super::build::build(),
19        Command::Host { config } => super::host::host(&config),
20    }
21}