diff options
| author | Conrad Ludgate <conradludgate@gmail.com> | 2021-02-14 18:00:41 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-14 18:00:41 +0000 |
| commit | bae59474eef3fd28758a2a4e5e4fb8d50c93a3c4 (patch) | |
| tree | d0c85ade3768dc9b04f6d94c9d9b5c360a17c257 /src/command/mod.rs | |
| parent | tidy some stuff (#6) (diff) | |
| download | atuin-bae59474eef3fd28758a2a4e5e4fb8d50c93a3c4.zip | |
a few more tiny touch ups (#7)
* a few more tiny touch ups
* all praise clippy
Diffstat (limited to '')
| -rw-r--r-- | src/command/mod.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/command/mod.rs b/src/command/mod.rs index 8d463bd6..4ac62385 100644 --- a/src/command/mod.rs +++ b/src/command/mod.rs @@ -1,4 +1,8 @@ +use eyre::Result; use structopt::StructOpt; +use uuid::Uuid; + +use crate::local::database::Sqlite; mod history; mod import; @@ -21,3 +25,18 @@ pub enum AtuinCmd { #[structopt(about = "generates a UUID")] Uuid, } + +impl AtuinCmd { + pub fn run(self, db: &mut Sqlite) -> Result<()> { + match self { + Self::History(history) => history.run(db), + Self::Import(import) => import.run(db), + Self::Server(server) => server.run(), + + Self::Uuid => { + println!("{}", Uuid::new_v4().to_simple().to_string()); + Ok(()) + } + } + } +} |
