aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-08-22 21:18:02 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-08-22 21:18:02 +0200
commitc9ea93f0b415dc3ea8c86ec0f5c5862c7b593a00 (patch)
tree9b5a9d3b48ecacb2deecf47358f931e1db497a8a
parentcrates/turtle/list: Restore the history listing code from atuin (diff)
downloadatuin-c9ea93f0b415dc3ea8c86ec0f5c5862c7b593a00.zip
treewide: Fix most `cargo check` warnings
The remaining ones, require actual work to resolve.
Diffstat (limited to '')
-rw-r--r--crates/client/src/command/client.rs15
-rw-r--r--crates/client/src/command/client/history/list.rs1
-rw-r--r--crates/client/src/command/client/sync.rs4
-rw-r--r--crates/client/src/command/client/wrapped.rs1
-rw-r--r--crates/client/src/main.rs1
-rw-r--r--crates/daemon/src/main.rs35
6 files changed, 34 insertions, 23 deletions
diff --git a/crates/client/src/command/client.rs b/crates/client/src/command/client.rs
index 60329500..0ecb4573 100644
--- a/crates/client/src/command/client.rs
+++ b/crates/client/src/command/client.rs
@@ -30,9 +30,6 @@ pub(crate) enum Cmd {
/// Request a sync or view sync status
Sync(sync::Cmd),
- // /// Manage the atuin data store
- // #[command(subcommand)]
- // Store(store::Cmd),
/// Information about dotfiles locations and ENV vars
#[command()]
Info,
@@ -78,6 +75,18 @@ impl Cmd {
let base_filter =
EnvFilter::from_env("ATUIN_LOG").add_directive("sqlx_sqlite::regexp=off".parse()?);
+ if env_log_set
+ && let Err(e) = tracing_subscriber::fmt()
+ .with_file(true)
+ .with_line_number(true)
+ .with_level(true)
+ .without_time()
+ .with_env_filter(base_filter)
+ .try_init()
+ {
+ eprintln!("failed to initialize logging: {e}");
+ }
+
tracing::trace!(command = ?self, "client command");
// Skip initializing any databases for history
diff --git a/crates/client/src/command/client/history/list.rs b/crates/client/src/command/client/history/list.rs
index 47ce3b99..6fd28660 100644
--- a/crates/client/src/command/client/history/list.rs
+++ b/crates/client/src/command/client/history/list.rs
@@ -155,6 +155,7 @@ fn print_list(
ListMode::CmdOnly => std::iter::once(ParseSegment::Key("command")).collect(),
};
+ #[expect(trivial_casts, reason = "It's more explicit with one")]
let iterator = if reverse {
Box::new(h.iter().rev()) as Box<dyn Iterator<Item = &History>>
} else {
diff --git a/crates/client/src/command/client/sync.rs b/crates/client/src/command/client/sync.rs
index 7297c659..d03dd926 100644
--- a/crates/client/src/command/client/sync.rs
+++ b/crates/client/src/command/client/sync.rs
@@ -67,8 +67,8 @@ async fn status_cmd(settings: &Settings) -> Result<()> {
// } else {
// bail!("You are not logged in to a sync server - cannot show sync status");
// }
-
- Ok(())
+ //
+ // Ok(())
}
async fn perform_cmd(settings: &Settings) -> Result<()> {
diff --git a/crates/client/src/command/client/wrapped.rs b/crates/client/src/command/client/wrapped.rs
index a47b81a1..4219aa2d 100644
--- a/crates/client/src/command/client/wrapped.rs
+++ b/crates/client/src/command/client/wrapped.rs
@@ -10,7 +10,6 @@ use turtle_api::{
use crate::{
atuin_client::settings::Settings,
atuin_history::stats::{Stats, compute},
- command::current_session,
};
#[derive(Debug)]
diff --git a/crates/client/src/main.rs b/crates/client/src/main.rs
index 4ec97cef..45f09b1f 100644
--- a/crates/client/src/main.rs
+++ b/crates/client/src/main.rs
@@ -12,7 +12,6 @@ use eyre::Result;
use command::AtuinCmd;
use tracing_subscriber::EnvFilter;
-use tracing_subscriber::util::SubscriberInitExt;
mod command;
diff --git a/crates/daemon/src/main.rs b/crates/daemon/src/main.rs
index 8fd3c119..d157d075 100644
--- a/crates/daemon/src/main.rs
+++ b/crates/daemon/src/main.rs
@@ -43,21 +43,6 @@ enum Cmd {
#[tokio::main]
async fn main() -> Result<()> {
- if let Err(e) = tracing_subscriber::fmt()
- .with_file(true)
- .with_line_number(true)
- .with_level(true)
- .without_time()
- .with_env_filter(
- EnvFilter::builder()
- .from_env_lossy()
- .add_directive("turtle_daemon=debug".parse().unwrap()),
- )
- .try_init()
- {
- eprintln!("failed to initialize logging: {e}");
- }
-
let settings = Settings::new().wrap_err("could not load client settings")?;
if !settings.paths_ok() {
bail!("Failed to verify all paths :(");
@@ -70,7 +55,25 @@ async fn main() -> Result<()> {
let sqlite_store = SqliteStore::new(record_store_path, settings.local_timeout).await?;
match Cmd::parse() {
- Cmd::Start { show_logs, .. } => boot(settings, sqlite_store, history_db).await,
+ Cmd::Start { show_logs, .. } => {
+ if show_logs
+ && let Err(e) = tracing_subscriber::fmt()
+ .with_file(true)
+ .with_line_number(true)
+ .with_level(true)
+ .without_time()
+ .with_env_filter(
+ EnvFilter::builder()
+ .from_env_lossy()
+ .add_directive("turtle_daemon=debug".parse().unwrap()),
+ )
+ .try_init()
+ {
+ eprintln!("failed to initialize logging: {e}");
+ }
+
+ boot(settings, sqlite_store, history_db).await
+ }
}
}