feat: config read from command line as '--c'
This commit is contained in:
1 parent
be82f8638a
commit
c69f4b0e38
1 file changed
+9
-1
+9
-1
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user