feat: config read from command line as '--c'

This commit is contained in:
2026-08-08 00:58:41 +02:00
parent be82f8638a
commit c69f4b0e38

View File

@@ -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); let word_source_result = FileDatabase::new(&config.database_path);