diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs index 302ba7a..b218f9b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,16 +45,20 @@ async fn main() -> Result<()> { std::process::exit(0); } - // Build default config - // let mut cfg = BibiConfig::default(); + if parsed_args + .cfg_path + .as_ref() + .is_some_and(|f| !f.try_exists().unwrap() || !f.is_file()) + { + BibiConfig::create_default_config(&parsed_args); + } - // if parsed_args.light_theme { - // cfg.light_colors(); - // } - // // Merge values from config file if present - // cfg.parse_config(&parsed_args)?; + let mut cfg = if parsed_args.cfg_path.is_some() { + BibiConfig::parse_config(&parsed_args)? + } else { + BibiConfig::default() + }; - let mut cfg = BibiConfig::parse_config(&parsed_args)?; init_error_hooks()?; // Create an application. |
