From 2ca7dd57b12861e8c9bbc9238cda612e0ff22ff3 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 12 Jun 2026 17:16:19 +0200 Subject: chore(treewide): Cleanup themes --- crates/turtle/src/command/client/daemon.rs | 36 +++++++++++------------------- 1 file changed, 13 insertions(+), 23 deletions(-) (limited to 'crates/turtle/src/command/client/daemon.rs') diff --git a/crates/turtle/src/command/client/daemon.rs b/crates/turtle/src/command/client/daemon.rs index cb5dd118..41cb04fe 100644 --- a/crates/turtle/src/command/client/daemon.rs +++ b/crates/turtle/src/command/client/daemon.rs @@ -22,16 +22,8 @@ use tokio::time::sleep; #[derive(clap::Args, Debug)] pub(crate) struct Cmd { - /// Internal flag for daemonization - #[arg(long, hide = true)] - daemonize: bool, - - /// Also write daemon logs to the console (useful for debugging) - #[arg(long)] - show_logs: bool, - #[command(subcommand)] - subcmd: Option, + subcmd: SubCmd, } #[derive(Subcommand, Debug)] @@ -67,8 +59,7 @@ impl Cmd { #[cfg(unix)] pub(crate) fn should_daemonize(&self) -> bool { match &self.subcmd { - Some(SubCmd::Start { daemonize, .. }) => *daemonize, - None => self.daemonize, + SubCmd::Start { daemonize, .. } => *daemonize, _ => false, } } @@ -76,8 +67,7 @@ impl Cmd { /// Returns `true` when logs should also be written to the console. pub(crate) fn show_logs(&self) -> bool { match &self.subcmd { - Some(SubCmd::Start { show_logs, .. }) => *show_logs, - None => self.show_logs, + SubCmd::Start { show_logs, .. } => *show_logs, _ => false, } } @@ -89,14 +79,10 @@ impl Cmd { history_db: ClientSqlite, ) -> Result<()> { match self.subcmd { - None => { - eprintln!("Warning: `atuin daemon` is deprecated, use `atuin daemon start`"); - run(settings, store, history_db, false).await - } - Some(SubCmd::Start { force, .. }) => run(settings, store, history_db, force).await, - Some(SubCmd::Status) => status_cmd(&settings).await, - Some(SubCmd::Stop) => stop_cmd(&settings).await, - Some(SubCmd::Restart) => restart_cmd(&settings).await, + SubCmd::Start { force, .. } => run(settings, store, history_db, force).await, + SubCmd::Status => status_cmd(&settings).await, + SubCmd::Stop => stop_cmd(&settings).await, + SubCmd::Restart => restart_cmd(&settings).await, } } } @@ -331,7 +317,6 @@ async fn wait_until_ready(settings: &Settings, timeout: Duration) -> Result Result<()> { #[cfg(unix)] if settings.daemon.systemd_socket { @@ -438,7 +423,12 @@ pub(crate) async fn start_history(settings: &Settings, history: History) -> Resu Ok(resp.id) } -pub(crate) async fn end_history(settings: &Settings, id: String, duration: u64, exit: i64) -> Result<()> { +pub(crate) async fn end_history( + settings: &Settings, + id: String, + duration: u64, + exit: i64, +) -> Result<()> { match async { connect_client(settings) .await? -- cgit v1.3.1