aboutsummaryrefslogtreecommitdiffstats
path: root/src/local/history.rs
diff options
context:
space:
mode:
authorEllie Huxtable <e@elm.sh>2020-10-05 00:59:28 +0100
committerEllie Huxtable <e@elm.sh>2020-10-05 00:59:28 +0100
commit27b9a9430518c071a2a7de7f46dfd8aac3cead80 (patch)
tree0551a4979606d7bf351149df10cf08f47dc9e665 /src/local/history.rs
downloadatuin-27b9a9430518c071a2a7de7f46dfd8aac3cead80.zip
Initial commit
Currently writing shell history to a sqlite db :) Could do with: 1) store exit code 2) store duration 3) tidy up main 4) ...remote stuff
Diffstat (limited to 'src/local/history.rs')
-rw-r--r--src/local/history.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/local/history.rs b/src/local/history.rs
new file mode 100644
index 00000000..61438b6d
--- /dev/null
+++ b/src/local/history.rs
@@ -0,0 +1,18 @@
+use chrono;
+
+#[derive(Debug)]
+pub struct History {
+ pub timestamp: i64,
+ pub command: String,
+ pub cwd: String,
+}
+
+impl History {
+ pub fn new(command: &str, cwd: &str) -> History {
+ History {
+ timestamp: chrono::Utc::now().timestamp_millis(),
+ command: command.to_string(),
+ cwd: cwd.to_string(),
+ }
+ }
+}