aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/src/history/builder.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-07-24 17:56:36 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-07-24 17:56:36 +0200
commit9cdc575666faad4c162f4b4cf519bfdd1fd528dc (patch)
tree9287963ad11e237ca74edbd54161c03f3309927b /crates/turtle/src/history/builder.rs
parentchore: Last big refactoring (diff)
downloadatuin-9cdc575666faad4c162f4b4cf519bfdd1fd528dc.zip
feat: Finalize design for fish-shell integration
Diffstat (limited to 'crates/turtle/src/history/builder.rs')
-rw-r--r--crates/turtle/src/history/builder.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/turtle/src/history/builder.rs b/crates/turtle/src/history/builder.rs
index 08d26f7f..57970301 100644
--- a/crates/turtle/src/history/builder.rs
+++ b/crates/turtle/src/history/builder.rs
@@ -1,3 +1,5 @@
+use std::time::Duration;
+
use typed_builder::TypedBuilder;
use super::History;
@@ -12,7 +14,7 @@ pub struct HistoryFromDb {
command: String,
cwd: String,
exit: i64,
- duration: i64,
+ duration: Duration,
session: String,
hostname: String,
author: String,
@@ -48,14 +50,19 @@ pub struct HistoryDaemonCapture {
timestamp: time::OffsetDateTime,
#[builder(setter(into))]
command: String,
+
#[builder(setter(into))]
cwd: String,
+
#[builder(setter(into))]
session: String,
+
#[builder(setter(into))]
hostname: String,
+
#[builder(default, setter(strip_option, into))]
author: Option<String>,
+
#[builder(default, setter(strip_option, into))]
intent: Option<String>,
}
@@ -67,7 +74,7 @@ impl From<HistoryDaemonCapture> for History {
captured.command,
captured.cwd,
-1,
- -1,
+ Duration::from_nanos(0),
captured.session,
captured.hostname,
captured.author,