aboutsummaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
authorTezkerek <andrei.ancuta@gmail.com>2018-06-07 19:53:16 +0300
committerChristian Duerr <chrisduerr@users.noreply.github.com>2018-06-07 16:53:16 +0000
commit66acf1e03da4d0206e3368bf58953b071887ccb2 (patch)
treebcdff68e708c02c75df6ffc0545d2fb5d13389d3 /src/cli.rs
parent93780ef0929e08f3c5212e5451152ecaf1a28813 (diff)
downloadalacritty-66acf1e03da4d0206e3368bf58953b071887ccb2.tar.gz
alacritty-66acf1e03da4d0206e3368bf58953b071887ccb2.zip
Add working --class and --title CLI parameters
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 532c46cd..e57caf0d 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -19,6 +19,7 @@ use std::path::{Path, PathBuf};
use std::borrow::Cow;
const DEFAULT_TITLE: &str = "Alacritty";
+const DEFAULT_CLASS: &str = "Alacritty";
/// Options specified on the command line
pub struct Options {
@@ -27,6 +28,7 @@ pub struct Options {
pub ref_test: bool,
pub dimensions: Option<Dimensions>,
pub title: String,
+ pub class: String,
pub log_level: log::LevelFilter,
pub command: Option<Shell<'static>>,
pub working_dir: Option<PathBuf>,
@@ -41,6 +43,7 @@ impl Default for Options {
ref_test: false,
dimensions: None,
title: DEFAULT_TITLE.to_owned(),
+ class: DEFAULT_CLASS.to_owned(),
log_level: log::LevelFilter::Warn,
command: None,
working_dir: None,
@@ -81,6 +84,10 @@ impl Options {
.short("t")
.default_value(DEFAULT_TITLE)
.help("Defines the window title"))
+ .arg(Arg::with_name("class")
+ .long("class")
+ .default_value(DEFAULT_CLASS)
+ .help("Defines window class on X11"))
.arg(Arg::with_name("q")
.short("q")
.multiple(true)
@@ -136,6 +143,10 @@ impl Options {
options.title = title.to_owned();
}
+ if let Some(class) = matches.value_of("class") {
+ options.class = class.to_owned();
+ }
+
match matches.occurrences_of("q") {
0 => {},
1 => options.log_level = log::LevelFilter::Error,