From 16346472e77565f35e3221b3713ec217f8685b20 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 3 Aug 2024 20:20:03 +0200 Subject: a --- src/main.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/main.rs (limited to 'src/main.rs') 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}"); + } + } + } +} -- cgit v1.2.3-70-g09d2