diff options
| author | Ellie Huxtable <e@elm.sh> | 2021-02-13 20:21:49 +0000 |
|---|---|---|
| committer | Ellie Huxtable <e@elm.sh> | 2021-02-13 20:24:22 +0000 |
| commit | 440c4fc2335d5286d14367e39c99bb4946efe9e3 (patch) | |
| tree | 766f33c9c6b87998f22bc146fe7361e798b377df /src/main.rs | |
| parent | Implement history import (diff) | |
| download | atuin-440c4fc2335d5286d14367e39c99bb4946efe9e3.zip | |
Add sessions
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 19357cbe..22c8b21d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ use std::path::PathBuf; use directories::ProjectDirs; use eyre::{eyre, Result}; use structopt::StructOpt; +use uuid::Uuid; #[macro_use] extern crate log; @@ -40,8 +41,11 @@ enum AtuinCmd { #[structopt(about = "import shell history from file")] Import(ImportCmd), - #[structopt(about = "start a atuin server")] + #[structopt(about = "start an atuin server")] Server, + + #[structopt(about = "generates a UUID")] + Uuid, } impl Atuin { @@ -66,8 +70,12 @@ impl Atuin { let mut db = SqliteDatabase::new(db_path)?; match self.atuin { - AtuinCmd::History(history) => history.run(db), + AtuinCmd::History(history) => history.run(&mut db), AtuinCmd::Import(import) => import.run(&mut db), + AtuinCmd::Uuid => { + println!("{}", Uuid::new_v4().to_simple().to_string()); + Ok(()) + } _ => Ok(()), } } |
