diff options
Diffstat (limited to 'src/command')
| -rw-r--r-- | src/command/history.rs | 12 | ||||
| -rw-r--r-- | src/command/import.rs | 13 |
2 files changed, 22 insertions, 3 deletions
diff --git a/src/command/history.rs b/src/command/history.rs index 72f821c5..4caf4c17 100644 --- a/src/command/history.rs +++ b/src/command/history.rs @@ -32,13 +32,21 @@ pub enum HistoryCmd { } impl HistoryCmd { - pub fn run(&self, db: SqliteDatabase) -> Result<()> { + pub fn run(&self, db: &mut SqliteDatabase) -> Result<()> { match self { HistoryCmd::Start { command: words } => { let command = words.join(" "); let cwd = env::current_dir()?.display().to_string(); - let h = History::new(chrono::Utc::now().timestamp_nanos(), command, cwd, -1, -1); + let h = History::new( + chrono::Utc::now().timestamp_nanos(), + command, + cwd, + -1, + -1, + None, + None, + ); // print the ID // we use this as the key for calling end diff --git a/src/command/import.rs b/src/command/import.rs index 5ece13a8..5ce0e749 100644 --- a/src/command/import.rs +++ b/src/command/import.rs @@ -87,12 +87,23 @@ impl ImportCmd { } pub fn run(&self, db: &mut SqliteDatabase) -> Result<()> { + println!(" A'Tuin "); + println!("====================="); + println!(" 🌍 "); + println!(" 🐘🐘🐘🐘 "); + println!(" 🐢 "); + println!("====================="); + println!("Importing history..."); + match self { ImportCmd::Auto => { let shell = env::var("SHELL").unwrap_or(String::from("NO_SHELL")); match shell.as_str() { - "/bin/zsh" => self.import_zsh(db), + "/bin/zsh" => { + println!("Detected ZSH"); + self.import_zsh(db) + } _ => { println!("cannot import {} history", shell); |
