diff options
| author | lukeflo | 2025-02-21 20:17:27 +0100 |
|---|---|---|
| committer | lukeflo | 2025-02-21 20:17:27 +0100 |
| commit | ddb6326c1896b82b759d930fb08ea46a820e275a (patch) | |
| tree | 8fd4db8081770e0c4b4bdbf3c680c48637da8a03 /src/main.rs | |
| parent | f60be8b6b1e5987613081c9ad8d63a26a1a1bac9 (diff) | |
| download | bibiman-ddb6326c1896b82b759d930fb08ea46a820e275a.tar.gz bibiman-ddb6326c1896b82b759d930fb08ea46a820e275a.zip | |
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<T>`
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 12 |
1 files changed, 7 insertions, 5 deletions
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()?; |
