From 27b9a9430518c071a2a7de7f46dfd8aac3cead80 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Mon, 5 Oct 2020 00:59:28 +0100 Subject: 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 --- src/local/history.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/local/history.rs (limited to 'src/local/history.rs') 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(), + } + } +} -- cgit v1.3.1