From 17741c49299181d7b2040665e97bad1427a059d3 Mon Sep 17 00:00:00 2001 From: Samuel Cabrero Date: Thu, 17 Aug 2023 09:02:24 +0200 Subject: [PATCH] daemon: kanidmd version requires a config file to run (#1959) (#1990) Signed-off-by: Samuel Cabrero --- CONTRIBUTORS.md | 1 + server/daemon/src/main.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index cb6e11dcb..d52f6d849 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -29,6 +29,7 @@ - Minh Phan (MinhPhan8803) - Kenton Groombridge (0xC0ncord) - Martin Weinelt (hexa) +- Samuel Cabrero (scabrero) ## Acknowledgements diff --git a/server/daemon/src/main.rs b/server/daemon/src/main.rs index f5c7e8876..1cc80c230 100644 --- a/server/daemon/src/main.rs +++ b/server/daemon/src/main.rs @@ -156,6 +156,12 @@ async fn main() -> ExitCode { // Read CLI args, determine what the user has asked us to do. let opt = KanidmdParser::parse(); + // print the app version and bail + if let KanidmdOpt::Version(_) = &opt.commands { + println!("kanidmd {}", env!("KANIDM_PKG_VERSION")); + return ExitCode::SUCCESS; + }; + //we set up a list of these so we can set the log config THEN log out the errors. let mut config_error: Vec = Vec::new(); let mut config = Configuration::new(); @@ -244,12 +250,6 @@ async fn main() -> ExitCode { (cuid, ceuid) }; - // print the app version and bail - if let KanidmdOpt::Version(_) = &opt.commands { - println!("kanidmd {}", env!("KANIDM_PKG_VERSION")); - return ExitCode::SUCCESS - }; - let sconfig = match sconfig { Some(val) => val, None => {