From ddb6326c1896b82b759d930fb08ea46a820e275a Mon Sep 17 00:00:00 2001 From: lukeflo Date: Fri, 21 Feb 2025 20:17:27 +0100 Subject: parse config file + set default values for config fields + merge fields named in the config file with default values + values from file take precedence over default values + to accomplish this, all config values are wrapped in `Option` --- src/main.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index d53aaab..8ec3b77 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,11 +45,13 @@ async fn main() -> Result<()> { std::process::exit(0); } - let mut cfg = if parsed_args.cfg_path.is_file() { - BibiConfig::new(&parsed_args)? - } else { - BibiConfig::default() - }; + // let mut cfg = if parsed_args.cfg_path.is_file() { + // BibiConfig::new(&parsed_args)? + // } else { + // BibiConfig::default() + // }; + let mut cfg = BibiConfig::default(); + cfg.parse_config(&parsed_args)?; init_error_hooks()?; -- cgit v1.2.3