aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/mod.rs
diff options
context:
space:
mode:
authorConrad Ludgate <conradludgate@gmail.com>2021-02-14 18:00:41 +0000
committerGitHub <noreply@github.com>2021-02-14 18:00:41 +0000
commitbae59474eef3fd28758a2a4e5e4fb8d50c93a3c4 (patch)
treed0c85ade3768dc9b04f6d94c9d9b5c360a17c257 /src/command/mod.rs
parenttidy some stuff (#6) (diff)
downloadatuin-bae59474eef3fd28758a2a4e5e4fb8d50c93a3c4.zip
a few more tiny touch ups (#7)
* a few more tiny touch ups * all praise clippy
Diffstat (limited to 'src/command/mod.rs')
-rw-r--r--src/command/mod.rs19
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(())
+ }
+ }
+ }
+}