From c69f4b0e389eec04c113c49a431947942ef7788f Mon Sep 17 00:00:00 2001 From: Daniel Heras Quesada Date: Sat, 8 Aug 2026 00:58:41 +0200 Subject: [PATCH] feat: config read from command line as '--c' --- src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index eaf6517..5a73d3d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,7 +30,15 @@ fn main() -> io::Result<()> { } }; - let config = read_config(DEFAULT_CONFIG_PATH, default_config); // TODO: read config from param + let config_path: &str = { + if args.len() > 2 && args[1] == "--c" { + &args[2] + } else { + DEFAULT_CONFIG_PATH + } + }; + + let config = read_config(config_path, default_config); let word_source_result = FileDatabase::new(&config.database_path);