aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorHristo Venev <hristo@venev.name>2020-02-04 22:58:37 +0100
committerHristo Venev <hristo@venev.name>2020-02-04 22:58:37 +0100
commit80589fb9c08e3c15b31db51c7a40767ff6fbf33d (patch)
treee75fc9e28a706e89c92fa04af8cbf51b8a574454 /src/main.rs
parente6c406879696a53d40f175d11d14a55d9480a57e (diff)
Move source names inside the source sections.
This means that the order of the sources is preserved.
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" {