acp/commands/watch.rs
1//! @acp:module "Watch Command"
2//! @acp:summary "Watch for changes and update cache"
3//! @acp:domain cli
4//! @acp:layer handler
5
6use std::path::PathBuf;
7
8use anyhow::Result;
9
10use crate::config::Config;
11use crate::watch::FileWatcher;
12
13/// Options for the watch command
14#[derive(Debug, Clone)]
15pub struct WatchOptions {
16 /// Root directory to watch
17 pub root: PathBuf,
18}
19
20/// Execute the watch command
21pub fn execute_watch(options: WatchOptions, config: Config) -> Result<()> {
22 let watcher = FileWatcher::new(config);
23 watcher.watch(&options.root)?;
24 Ok(())
25}