diff options
Diffstat (limited to 'crates/dinggerd/src/main.rs')
| -rw-r--r-- | crates/dinggerd/src/main.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/dinggerd/src/main.rs b/crates/dinggerd/src/main.rs index 4c8521c..61d9c15 100644 --- a/crates/dinggerd/src/main.rs +++ b/crates/dinggerd/src/main.rs @@ -1,5 +1,7 @@ //! dingger: agent state watching for tmux panes. +mod hooks; +mod integrations; mod manifest_update; mod notify; mod tmux; @@ -39,6 +41,11 @@ enum Command { /// Name of the tmux client that clicked, passed as #{client_name}. client: Option<String>, }, + /// Install agent integrations (hook extensions that report state). + Install { + /// Agent to install the integration for. + agent: String, + }, } #[derive(Subcommand)] @@ -59,6 +66,10 @@ fn main() { interval_secs, no_sounds, } => { + if let Err(err) = hooks::spawn_listener() { + eprintln!("dingger: {err}"); + std::process::exit(1); + } let mut watcher = watcher::Watcher::new(interval_secs, !no_sounds); if let Err(err) = watcher.run() { eprintln!("dingger: {err}"); @@ -85,6 +96,12 @@ fn main() { std::process::exit(1); } } + Command::Install { agent } => { + if let Err(err) = integrations::install(&agent) { + eprintln!("dingger: {err}"); + std::process::exit(1); + } + } } } |
