aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/input/options.rs
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2022-06-07 21:32:04 +0200
committerGitHub <noreply@github.com>2022-06-07 21:32:04 +0200
commit3ee214ef3567bbc94a571380c16605d84d21a947 (patch)
tree722d8fb7f9e0dc535b43d3720202ace66aff5cf3 /zellij-utils/src/input/options.rs
parentremove: obsolete comment (#1465) (diff)
downloadsl0ppij-3ee214ef3567bbc94a571380c16605d84d21a947.tar.gz
sl0ppij-3ee214ef3567bbc94a571380c16605d84d21a947.tar.xz
sl0ppij-3ee214ef3567bbc94a571380c16605d84d21a947.zip
add(option): `default_layout` (#1467)
* add(option): `default_layout` Add `option` `default_layout` / `default-layout`, that allows specifying a different layout, that should be loaded on start. Eg: ``` default_layout: compact ``` * add(manpage): `default_layout`
Diffstat (limited to 'zellij-utils/src/input/options.rs')
-rw-r--r--zellij-utils/src/input/options.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/zellij-utils/src/input/options.rs b/zellij-utils/src/input/options.rs
index bc23cf3c..22dc0a55 100644
--- a/zellij-utils/src/input/options.rs
+++ b/zellij-utils/src/input/options.rs
@@ -52,6 +52,9 @@ pub struct Options {
/// Set the default shell
#[clap(long, parse(from_os_str))]
pub default_shell: Option<PathBuf>,
+ /// Set the default layout
+ #[clap(long, parse(from_os_str))]
+ pub default_layout: Option<PathBuf>,
/// Set the layout_dir, defaults to
/// subdirectory of config dir
#[clap(long, parse(from_os_str))]
@@ -128,6 +131,7 @@ impl Options {
let simplified_ui = other.simplified_ui.or(self.simplified_ui);
let default_mode = other.default_mode.or(self.default_mode);
let default_shell = other.default_shell.or_else(|| self.default_shell.clone());
+ let default_layout = other.default_layout.or_else(|| self.default_layout.clone());
let layout_dir = other.layout_dir.or_else(|| self.layout_dir.clone());
let theme = other.theme.or_else(|| self.theme.clone());
let on_force_close = other.on_force_close.or(self.on_force_close);
@@ -144,6 +148,7 @@ impl Options {
theme,
default_mode,
default_shell,
+ default_layout,
layout_dir,
mouse_mode,
pane_frames,
@@ -179,6 +184,7 @@ impl Options {
let default_mode = other.default_mode.or(self.default_mode);
let default_shell = other.default_shell.or_else(|| self.default_shell.clone());
+ let default_layout = other.default_layout.or_else(|| self.default_layout.clone());
let layout_dir = other.layout_dir.or_else(|| self.layout_dir.clone());
let theme = other.theme.or_else(|| self.theme.clone());
let on_force_close = other.on_force_close.or(self.on_force_close);
@@ -195,6 +201,7 @@ impl Options {
theme,
default_mode,
default_shell,
+ default_layout,
layout_dir,
mouse_mode,
pane_frames,
@@ -247,6 +254,7 @@ impl From<CliOptions> for Options {
theme: opts.theme,
default_mode: opts.default_mode,
default_shell: opts.default_shell,
+ default_layout: opts.default_layout,
layout_dir: opts.layout_dir,
mouse_mode: opts.mouse_mode,
pane_frames: opts.pane_frames,