aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorEllie Huxtable <e@elm.sh>2021-02-14 13:28:01 +0000
committerEllie Huxtable <e@elm.sh>2021-02-14 13:28:01 +0000
commitd128297e67c49b4142e8535241c65efcc0ed640e (patch)
tree10ea1626126c4c8a569f12e72f137886ff48f44c /src/main.rs
parentUpdate readme (diff)
downloadatuin-d128297e67c49b4142e8535241c65efcc0ed640e.zip
Make clippy annoying asf + add server
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 835ebc86..adcced91 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,3 +1,7 @@
+#![feature(proc_macro_hygiene)]
+#![feature(decl_macro)]
+#![warn(clippy::pedantic)]
+
use std::path::PathBuf;
use directories::ProjectDirs;
@@ -8,12 +12,16 @@ use uuid::Uuid;
#[macro_use]
extern crate log;
-use command::{history::HistoryCmd, import::ImportCmd};
+#[macro_use]
+extern crate rocket;
+
+use command::{history::HistoryCmd, import::ImportCmd, server::ServerCmd};
use local::database::SqliteDatabase;
use local::history::History;
mod command;
mod local;
+mod server;
#[derive(StructOpt)]
#[structopt(
@@ -41,7 +49,7 @@ enum AtuinCmd {
Import(ImportCmd),
#[structopt(about = "start an atuin server")]
- Server,
+ Server(ServerCmd),
#[structopt(about = "generates a UUID")]
Uuid,
@@ -71,11 +79,12 @@ impl Atuin {
match self.atuin {
AtuinCmd::History(history) => history.run(&mut db),
AtuinCmd::Import(import) => import.run(&mut db),
+ AtuinCmd::Server(server) => server.run(),
+
AtuinCmd::Uuid => {
println!("{}", Uuid::new_v4().to_simple().to_string());
Ok(())
}
- _ => Ok(()),
}
}
}