From 44b98d0657fcbf818be5f2b25b80830c14050177 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Thu, 16 Oct 2025 11:00:38 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(cli):=20load=20configurations?= =?UTF-8?q?=20from=20toml=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - load configurations from `cull-gmail.toml` - set default value for rules in config --- src/cli/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cli/main.rs b/src/cli/main.rs index 691270e..fd41d70 100644 --- a/src/cli/main.rs +++ b/src/cli/main.rs @@ -87,12 +87,13 @@ fn get_logging(level: log::LevelFilter) -> env_logger::Builder { fn get_config() -> Result { let home_dir = env::home_dir().unwrap(); - let path = home_dir.join(".cull-gmail/rules.toml"); - log::trace!("Loading config from {}", path.display()); + let path = home_dir.join(".cull-gmail/cull-gmail.toml"); + log::info!("Loading config from {}", path.display()); let configurations = config::Config::builder() .set_default("credentials", "credential.json")? .set_default("config_root", "h:.cull-gmail")? + .set_default("rules", "rules.toml")? // Add in `./Settings.toml` .add_source(config::File::with_name( path.to_path_buf().to_str().unwrap(),