#![expect(unused_crate_dependencies, reason = "Didn't remove them yet")] use clap::Parser; use eyre::{Result, WrapErr}; use std::path::PathBuf; use turtle_daemon::aclient::{ database::ClientSqlite, record::sqlite_store::SqliteStore, settings::Settings, }; use turtle_daemon::api::client::{Probe, probe}; #[derive(Parser, Debug)] #[command(infer_subcommands = true)] pub(crate) enum Cmd { /// Start the daemon server Start { /// Also write daemon logs to the console (useful for debugging) #[arg(long)] show_logs: bool, }, } #[tokio::main] async fn main() -> Result<()> { let settings = Settings::new().wrap_err("could not load client settings")?; let db_path = PathBuf::from(settings.db_path.as_str()); let record_store_path = PathBuf::from(settings.record_store_path.as_str()); let history_db = ClientSqlite::new(db_path, settings.local_timeout).await?; let sqlite_store = SqliteStore::new(record_store_path, settings.local_timeout).await?; match Cmd::parse() { Cmd::Start { show_logs, .. } => { turtle_daemon::boot(settings, sqlite_store, history_db).await } } }