diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 9a4e692..3687cd0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ use std::collections::HashMap; +use std::env::current_dir; use std::ffi::OsStr; use std::fs; use std::io::{self, IsTerminal, Read, Write}; @@ -60,7 +61,13 @@ type bstr = [u8]; #[derive(Clone)] struct HistoryEntry { + /// time of execution pub time: date::DateTime, + + /// absolute path where the command was executed + pub loc: BString, + + /// the command pub cmd: BString, } @@ -68,6 +75,7 @@ impl HistoryEntry { pub fn new(cmd: BString) -> Self { Self { time: date::DateTime::now(), + loc: current_dir().unwrap().as_os_str().as_encoded_bytes().to_vec(), cmd, } } |
