Skip to content

Commit

Permalink
Fix error when *port in cli-args (#329)
Browse files Browse the repository at this point in the history
* Fix error when *port in cli-args

* Update cli/src/config.rs

Co-authored-by: Liu-Cheng Xu <xuliuchengxlc@gmail.com>
  • Loading branch information
alannotnerd and liuchengxu authored Nov 6, 2020
1 parent 038ae7a commit e13a2b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ fn extend_cli_args(
.collect::<Vec<_>>();

let mut config_opts = Vec::new();
let mut default_opts = default_opts;
let mut default_opts = default_opts
.into_iter()
.filter(|(k, _)| !cli_opts.contains(&format!("--{}", k).as_ref()))
.collect::<HashMap<_, _>>();

if let Some(path) = path {
for (key, value) in read_config_file(path)?.into_iter() {
// Remove the option that has been configured in the config file.
if default_opts.contains_key(key.as_str()) {
default_opts.remove(key.as_str());
}
Expand Down

0 comments on commit e13a2b8

Please sign in to comment.