use clap::{Parser, Subcommand}; mod app { pub mod ports; pub mod service; } mod adapters { pub mod driven { pub mod for_getting_violation_data; pub mod for_monitoring_system; pub mod for_sending_notification; } } mod actors { pub mod driven { pub mod for_formatting_message { pub mod alert_formatter; } } } mod configurator; #[derive(Parser)] #[command(name = "node-notifier")] #[command(about = "A system monitoring and notification tool")] struct Cli { #[command(subcommand)] command: Commands, } #[derive(Subcommand)] enum Commands { /// Monitor system and alert on threshold violations Run, /// Send all system metrics notification Get, } fn main() { let cli = Cli::parse(); let service = configurator::get_service(); match cli.command { Commands::Run => { if let Err(e) = service.alert_on_threshold_violation() { eprintln!("Error during threshold violation check: {}", e); } } Commands::Get => { if let Err(e) = service.send_all_metrics_notification() { eprintln!("Error sending final notification: {}", e); } } } }