diff options
| author | Ellie Huxtable <e@elm.sh> | 2021-02-13 17:02:52 +0000 |
|---|---|---|
| committer | Ellie Huxtable <e@elm.sh> | 2021-02-13 17:02:52 +0000 |
| commit | 7e60ace610ea3d137fac8fd6cfb26a1f5411a609 (patch) | |
| tree | 493142aa562fa379f82e4f6b2e2a79fa7f9b085b /src/local/history.rs | |
| parent | Begin import (diff) | |
| download | atuin-7e60ace610ea3d137fac8fd6cfb26a1f5411a609.zip | |
Record command exit code and duration
Diffstat (limited to 'src/local/history.rs')
| -rw-r--r-- | src/local/history.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/local/history.rs b/src/local/history.rs index e84d718c..3c9a9069 100644 --- a/src/local/history.rs +++ b/src/local/history.rs @@ -1,18 +1,25 @@ use chrono; +use uuid::Uuid; #[derive(Debug)] pub struct History { + pub id: String, pub timestamp: i64, + pub duration: i64, + pub exit: i64, pub command: String, pub cwd: String, } impl History { - pub fn new(command: String, cwd: String) -> History { + pub fn new(command: String, cwd: String, exit: i64, duration: i64) -> History { History { + id: Uuid::new_v4().to_simple().to_string(), timestamp: chrono::Utc::now().timestamp_millis(), command, cwd, + exit, + duration, } } } |
