diff options
| author | Teddy Wing | 2018-10-29 23:17:13 +0100 |
|---|---|---|
| committer | Teddy Wing | 2018-10-29 23:17:13 +0100 |
| commit | a8ed0e740b41eb6cc08151f33911d5c8a7866727 (patch) | |
| tree | b35b6f0139513d18ea8bb45cc28aa5245703361b | |
| parent | 52ee9fc272d3cbc19a47b6903c884a58b171d043 (diff) | |
| download | dome-key-map-a8ed0e740b41eb6cc08151f33911d5c8a7866727.tar.bz2 | |
parse_args(): Don't make `--audio` exclusive
This argument is meant to be use in conjunction with the `--daemon`
argument. What we had before was preventing audio from getting turned on
if `--daemon` was passed first and vice versa.
I just added to the existing if-else block without thinking. This makes
the condition separate.
| -rw-r--r-- | src/config.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs index 4befa4c..5d37fab 100644 --- a/src/config.rs +++ b/src/config.rs @@ -83,12 +83,14 @@ pub fn parse_args<'a>(args: &[String], config: &'a mut Config) -> &'a mut Config return config; } + if matches.opt_present("audio") { + config.args.audio = true; + } + if matches.opt_present("r") { config.args.reload = true; } else if matches.opt_present("d") { config.args.daemon = true; - } else if matches.opt_present("audio") { - config.args.audio = true; } else if let Some(license_path) = matches.opt_str("license") { match CString::new(license_path) { Ok(str) => config.args.license = str.into_raw(), |
