From 6636f5878ac11d6461b9958af025021486a7d58f Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Sun, 14 Feb 2021 18:40:51 +0000 Subject: zsh bin is sometimes /usr/bin/zsh or might be elsewhere too (#8) zsh also uses ~/.zsh_history get better errors for not found history file --- src/command/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/command/mod.rs') diff --git a/src/command/mod.rs b/src/command/mod.rs index 4ac62385..2e8d4778 100644 --- a/src/command/mod.rs +++ b/src/command/mod.rs @@ -26,6 +26,10 @@ pub enum AtuinCmd { Uuid, } +pub fn uuid_v4() -> String { + Uuid::new_v4().to_simple().to_string() +} + impl AtuinCmd { pub fn run(self, db: &mut Sqlite) -> Result<()> { match self { @@ -34,7 +38,7 @@ impl AtuinCmd { Self::Server(server) => server.run(), Self::Uuid => { - println!("{}", Uuid::new_v4().to_simple().to_string()); + println!("{}", uuid_v4()); Ok(()) } } -- cgit v1.3.1