summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..6bc049b
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,29 @@
+pub mod daemon;
+
+use clap::{Parser, Subcommand};
+use daemon::daemon;
+use log::error;
+
+#[derive(Parser)]
+struct Args {
+ #[clap(subcommand)]
+ action: Action,
+}
+
+#[derive(Subcommand)]
+enum Action {
+ Daemon,
+}
+
+fn main() {
+ env_logger::init_from_env("LOG");
+ let args = Args::parse();
+
+ match args.action {
+ Action::Daemon => {
+ if let Err(e) = daemon() {
+ error!("fatal error: {e}");
+ }
+ }
+ }
+}