daemon: kanidmd version requires a config file to run (#1959) (#1990)

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
This commit is contained in:
Samuel Cabrero 2023-08-17 09:02:24 +02:00 committed by GitHub
parent bc341af9d8
commit 17741c4929
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View file

@ -29,6 +29,7 @@
- Minh Phan (MinhPhan8803)
- Kenton Groombridge (0xC0ncord)
- Martin Weinelt (hexa)
- Samuel Cabrero (scabrero)
## Acknowledgements

View file

@ -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<String> = 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 => {