From bae59474eef3fd28758a2a4e5e4fb8d50c93a3c4 Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Sun, 14 Feb 2021 18:00:41 +0000 Subject: a few more tiny touch ups (#7) * a few more tiny touch ups * all praise clippy --- src/command/mod.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/command') 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(()) + } + } + } +} -- cgit v1.3.1