feat: config read from command line as '--c'
This commit is contained in:
10
src/main.rs
10
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user