diff options
author | a-kenji <aks.kenji@protonmail.com> | 2021-09-13 16:23:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-13 16:23:22 +0200 |
commit | 9a5a315aee615ae85959ee3cd76e1b8893282fbf (patch) | |
tree | d9a8cff0f1c0d4aa0ecf4d40fd214de7c8577934 /zellij-utils/src/cli.rs | |
parent | cfdc2eabfa31ef7e907a325e235dcac8cf748c36 (diff) |
Add `options` subcommand to `attach` (#718)
fixes #688
- the `options` subcommand of `attach` functions the same,
as the `options` subcommand of creating the normal session,
but not every option will have an effect on reattaching,
for example the `default_mode` setting would make no sense
to switch.
In the future it would make sense to be able to hot swap some
of the options on reattach, but we are not able to do that yet,
for example the `default_shell` one.
Eg:
```
zellij attach <session-name> options --theme <theme>
```
Diffstat (limited to 'zellij-utils/src/cli.rs')
-rw-r--r-- | zellij-utils/src/cli.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/zellij-utils/src/cli.rs b/zellij-utils/src/cli.rs index 2ac0e986b..a8dc9c0aa 100644 --- a/zellij-utils/src/cli.rs +++ b/zellij-utils/src/cli.rs @@ -63,6 +63,13 @@ pub enum Command { } #[derive(Debug, StructOpt, Clone, Serialize, Deserialize)] +pub enum SessionCommand { + /// Change the behaviour of zellij + #[structopt(name = "options")] + Options(Options), +} + +#[derive(Debug, StructOpt, Clone, Serialize, Deserialize)] pub enum Sessions { /// List active sessions #[structopt(alias = "ls")] @@ -78,5 +85,8 @@ pub enum Sessions { /// zellij client (if any) and attach to this. #[structopt(long, short)] force: bool, + /// Change the behaviour of zellij + #[structopt(subcommand, name = "options")] + options: Option<SessionCommand>, }, } |