aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorlukeflo2025-02-17 20:55:46 +0100
committerlukeflo2025-02-17 20:55:46 +0100
commitd443843d352d740b895c4d622eb9af9567aa7423 (patch)
tree5b61ec01b2d54461c423b97e2a702e7ec7daded9 /src/main.rs
parent059591a1be6b887eaca9b114fdb5b350a65bae43 (diff)
downloadbibiman-d443843d352d740b895c4d622eb9af9567aa7423.tar.gz
bibiman-d443843d352d740b895c4d622eb9af9567aa7423.zip
improve file handling
+ If config file **and** CLI args have different files/dirs, concat them and open all + Adapt UI to show which files are choosen + TODO: Flag for ignoring config file
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index a0f69d1..94f5042 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -45,12 +45,16 @@ async fn main() -> Result<()> {
std::process::exit(0);
}
- let cfg = BibiConfig::new(&mut parsed_args)?;
+ let mut cfg = if parsed_args.cfg_path.is_file() {
+ BibiConfig::new(&parsed_args)?
+ } else {
+ BibiConfig::default(&parsed_args)
+ };
init_error_hooks()?;
// Create an application.
- let mut app = App::new(&parsed_args)?;
+ let mut app = App::new(&mut parsed_args, &mut cfg)?;
app.run(&mut parsed_args).await?;
Ok(())