sbom_tools/cli/watch.rs
1//! CLI handler for the `watch` subcommand.
2
3use crate::config::WatchConfig;
4use crate::watch::WatchError;
5use anyhow::Result;
6
7/// Run the watch command with the given configuration.
8pub fn run_watch(config: WatchConfig) -> Result<()> {
9 // Validate that all watch directories exist
10 for dir in &config.watch_dirs {
11 if !dir.is_dir() {
12 return Err(WatchError::DirNotFound(dir.clone()).into());
13 }
14 }
15
16 crate::watch::run_watch_loop(&config)
17}