diff options
author | Joe Wilm <joe@jwilm.com> | 2017-08-29 09:26:52 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2017-08-29 09:32:37 -0700 |
commit | 59c1dbf5fe36a6041783f25ee60800ba1601e3c3 (patch) | |
tree | cfaf5e5bce1c7c5c79e98030626a3622d1c7fd54 /src/cli.rs | |
parent | adcd517669f96a2a848c933df3776f2a3d9ac2d5 (diff) | |
download | alacritty-59c1dbf5fe36a6041783f25ee60800ba1601e3c3.tar.gz alacritty-59c1dbf5fe36a6041783f25ee60800ba1601e3c3.zip |
Change CLI live-config-reload options into flags
The previous format of --live-config-reload=VAL had a specific set of
allowed values which may not immediately be obvious. Instead, there are
now two flags which control the behavior:
--live-config-reload
--no-live-config-reload
If a user tries to specify both, the option parsing will fail with this
message:
error: The argument '--no-live-config-reload' cannot be used with
'--live-config-reload'
Diffstat (limited to 'src/cli.rs')
-rw-r--r-- | src/cli.rs | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -63,9 +63,11 @@ impl Options { .help("Generates ref test")) .arg(Arg::with_name("live-config-reload") .long("live-config-reload") - .help("Live configuration reload") - .takes_value(true) - .use_delimiter(false)) + .help("Enable automatic config reloading")) + .arg(Arg::with_name("no-live-config-reload") + .long("no-live-config-reload") + .help("Disable automatic config reloading") + .conflicts_with("live-config-reload")) .arg(Arg::with_name("print-events") .long("print-events")) .arg(Arg::with_name("dimensions") @@ -114,12 +116,10 @@ impl Options { options.print_events = true; } - if let Some(val) = matches.value_of("live-config-reload") { - match val { - "y" | "yes" => options.live_config_reload = Some(true), - "n" | "no" => options.live_config_reload = Some(false), - _ => options.live_config_reload = None, - } + if matches.is_present("live-config-reload") { + options.live_config_reload = Some(true); + } else if matches.is_present("no-live-config-reload") { + options.live_config_reload = Some(false); } if let Some(mut dimensions) = matches.values_of("dimensions") { |