diff options
author | Tezkerek <andrei.ancuta@gmail.com> | 2018-06-07 19:53:16 +0300 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-06-07 16:53:16 +0000 |
commit | 66acf1e03da4d0206e3368bf58953b071887ccb2 (patch) | |
tree | bcdff68e708c02c75df6ffc0545d2fb5d13389d3 /src/cli.rs | |
parent | 93780ef0929e08f3c5212e5451152ecaf1a28813 (diff) | |
download | alacritty-66acf1e03da4d0206e3368bf58953b071887ccb2.tar.gz alacritty-66acf1e03da4d0206e3368bf58953b071887ccb2.zip |
Add working --class and --title CLI parameters
Diffstat (limited to 'src/cli.rs')
-rw-r--r-- | src/cli.rs | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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, |