aboutsummaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
authorLiu Wei <liuw@liuw.name>2017-08-29 17:32:08 +0100
committerJoe Wilm <jwilm@users.noreply.github.com>2017-08-29 09:32:08 -0700
commitb38d825921ac20d9f6543c23ed3bc0a44a0bdf2d (patch)
tree226a3e48f82392933ee218efc336b08aa71c43b8 /src/cli.rs
parent6495ab34d2043440f138242cf58d39e687e6c02e (diff)
downloadalacritty-b38d825921ac20d9f6543c23ed3bc0a44a0bdf2d.tar.gz
alacritty-b38d825921ac20d9f6543c23ed3bc0a44a0bdf2d.zip
Implement options to not start the config_monitor thread (#689)
Provide a command line option as well as a configuration file option. The command line option takes precedence.
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 789b1755..ea5610eb 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -22,6 +22,7 @@ const DEFAULT_TITLE: &'static str = "Alacritty";
/// Options specified on the command line
pub struct Options {
+ pub live_config_reload: Option<bool>,
pub print_events: bool,
pub ref_test: bool,
pub dimensions: Option<Dimensions>,
@@ -35,6 +36,7 @@ pub struct Options {
impl Default for Options {
fn default() -> Options {
Options {
+ live_config_reload: None,
print_events: false,
ref_test: false,
dimensions: None,
@@ -59,6 +61,11 @@ impl Options {
.arg(Arg::with_name("ref-test")
.long("ref-test")
.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))
.arg(Arg::with_name("print-events")
.long("print-events"))
.arg(Arg::with_name("dimensions")
@@ -107,6 +114,14 @@ 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 let Some(mut dimensions) = matches.values_of("dimensions") {
let width = dimensions.next().map(|w| w.parse().map(|w| Column(w)));
let height = dimensions.next().map(|h| h.parse().map(|h| Line(h)));