use fluxframe_core::FluxError;
use crate::cli::{Cli, Command};
#[cfg(feature = "ml")]
pub mod benchmark;
pub mod check;
pub mod list;
pub mod run;
pub fn dispatch(cli: Cli) -> Result<(), FluxError> {
match cli.command {
Command::List => list::run(),
Command::Check(args) => check::run(args),
Command::Run(args) => run::run(args),
#[cfg(feature = "ml")]
Command::Benchmark(args) => benchmark::run(args),
#[cfg(not(feature = "ml"))]
Command::Benchmark(_) => Err(FluxError::Config {
reason: "this build was compiled without the `ml` feature".into(),
hint: Some(
"rebuild with `cargo build -p fluxframe-cli --features ml` \
to enable the inference benchmark"
.into(),
),
}),
}
}