diff options
| author | a-kenji <aks.kenji@protonmail.com> | 2021-07-22 16:19:46 +0200 |
|---|---|---|
| committer | a-kenji <aks.kenji@protonmail.com> | 2021-07-22 16:40:36 +0200 |
| commit | 903cb68a40979ff3020f431db4a8222eb607e238 (patch) | |
| tree | ef9a906587db6ecb358faa579cbdebbc765f46bc /src | |
| parent | chore(changelog): add logging feature (diff) | |
| download | sl0ppij-903cb68a40979ff3020f431db4a8222eb607e238.tar.gz sl0ppij-903cb68a40979ff3020f431db4a8222eb607e238.tar.xz sl0ppij-903cb68a40979ff3020f431db4a8222eb607e238.zip | |
Add cmd to dump layout to stdout
Adds the ability to dump the default layouts to
stdout, similar to the `zellij setup --dump-config`,
but now it needs the name of a currently existing
layout:
- default
- strider
- disable-status
`zellij setup --dump-layout [LAYOUT]`
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 612e130e..22f373a2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,8 +36,14 @@ pub fn main() { let config_options = Options::from_cli(&config.options, opts.command.clone()); if let Some(Command::Setup(ref setup)) = opts.command { - Setup::from_cli(setup, &opts, &config_options).expect("Failed to print to stdout"); - } + Setup::from_cli(setup, &opts, &config_options).map_or_else( + |e| { + eprintln!("{:?}", e); + process::exit(1); + }, + |_| {}, + ); + }; atomic_create_dir(&*ZELLIJ_TMP_DIR).unwrap(); atomic_create_dir(&*ZELLIJ_TMP_LOG_DIR).unwrap(); |
