killswitch/cli/start.rs
1use crate::cli::{commands, dispatch, verbosity};
2use anyhow::Result;
3
4/// Start the CLI application
5///
6/// # Errors
7/// Returns an error if:
8/// - Argument dispatching fails
9/// - Action execution fails
10pub fn start() -> Result<()> {
11 let matches = commands::new().get_matches();
12
13 let verbosity_count = matches.get_count("verbose");
14 let verbosity = verbosity::Verbosity::from(verbosity_count);
15
16 let action = dispatch::handler(&matches, verbosity)?;
17 action.execute()?;
18
19 Ok(())
20}
21
22#[cfg(test)]
23mod tests {
24 #[test]
25 fn test_start_compiles() {
26 // The start function is tested via integration
27 // This just verifies the module compiles
28 }
29}