aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 462da48..2ab02af 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -109,13 +109,15 @@ fn cli_config(mut args: impl Iterator<Item = OsString>) -> Option<config::Config
if key == "source" {
let name = args.next()?.into_string().ok()?;
let url = args.next()?.into_string().ok()?;
- cur = State::Source(cfg.sources.entry(name).or_insert(config::Source {
+ cfg.sources.push(config::Source {
+ name,
url,
psk: None,
ipv4: model::Ipv4Set::new(),
ipv6: model::Ipv6Set::new(),
required: false,
- }));
+ });
+ cur = State::Source(cfg.sources.last_mut().unwrap());
continue;
}
if key == "peer" {