use sage::Identity; use sheepd_core::{ args::{SheepdArgs, SheepdCommand}, config::AgentConfig, }; mod api; mod sheepd_core; use rumqttc::AsyncClient; use tokio::sync::OnceCell; pub static MQTT: OnceCell = OnceCell::const_new(); pub static IDENTITY: OnceCell = OnceCell::const_new(); pub static AGENT: OnceCell = OnceCell::const_new(); #[tokio::main] async fn main() { tracing_subscriber::fmt::init(); let args: SheepdArgs = argh::from_env(); if let Some(command) = args.command { match command { SheepdCommand::Join(join_command) => sheepd_core::cmd::join(join_command), } } else { sheepd_core::daemon::start_daemon().await; } }