aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2018-10-29 22:45:21 +0100
committerTeddy Wing2018-10-29 22:45:21 +0100
commit223651a128363353dc0d7815171e0ba49000a764 (patch)
tree3478ab9ca213113073b543697d54f98ee4357a44 /src
parent9a3775c3b4d557e29021c8a5490634957ae23e6a (diff)
downloaddome-key-map-223651a128363353dc0d7815171e0ba49000a764.tar.bz2
config: Add an `--audio` command line flag
Including this flag will tell the program to play interface audio (namely the sounds for mode activated & deactivated).
Diffstat (limited to 'src')
-rw-r--r--src/config.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index bcaf714..4befa4c 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -16,6 +16,7 @@ type Milliseconds = u16;
pub struct Args {
pub reload: bool,
pub daemon: bool,
+ pub audio: bool,
pub version: bool,
pub license: *mut c_char,
}
@@ -25,6 +26,7 @@ impl Default for Args {
Args {
reload: false,
daemon: false,
+ audio: false,
version: false,
license: ptr::null_mut(),
}
@@ -61,6 +63,7 @@ pub fn parse_args<'a>(args: &[String], config: &'a mut Config) -> &'a mut Config
opts.optflag("d", "daemon", "run the daemon in the current shell");
opts.optflag("r", "reload-mappings", "reload the mappings file");
+ opts.optflag("", "audio", "play interface audio");
opts.optopt(
"",
"license",
@@ -84,6 +87,8 @@ pub fn parse_args<'a>(args: &[String], config: &'a mut Config) -> &'a mut Config
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(),