diff options
| author | Aram Drevekenin <aram@poor.dev> | 2024-03-20 18:34:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-20 18:34:50 +0100 |
| commit | ec6d627b06dac2aaf94b1e2f8e55b889986bcc08 (patch) | |
| tree | af6d382a4c44027329384b25a704037bf867ae7f /src | |
| parent | docs(changelog): various race fixes (diff) | |
| download | sl0ppij-ec6d627b06dac2aaf94b1e2f8e55b889986bcc08.tar.gz sl0ppij-ec6d627b06dac2aaf94b1e2f8e55b889986bcc08.tar.xz sl0ppij-ec6d627b06dac2aaf94b1e2f8e55b889986bcc08.zip | |
chore(integrations): zpipe alias (#3210)
* chore(completions): zpipe alias
* chore(integrations): zpipe alias
Diffstat (limited to 'src')
| -rw-r--r-- | src/commands.rs | 20 | ||||
| -rw-r--r-- | src/main.rs | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/commands.rs b/src/commands.rs index cde96b12..f27f0c55 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -667,3 +667,23 @@ fn generate_unique_session_name() -> String { process::exit(1); } } + +pub(crate) fn list_aliases(opts: CliArgs) { + let (config, _layout, _config_options, _config_without_layout, _config_options_without_layout) = + match Setup::from_cli_args(&opts) { + Ok(results) => results, + Err(e) => { + if let ConfigError::KdlError(error) = e { + let report: Report = error.into(); + eprintln!("{:?}", report); + } else { + eprintln!("{}", e); + } + process::exit(1); + }, + }; + for alias in config.plugins.list() { + println!("{}", alias); + } + process::exit(0); +} diff --git a/src/main.rs b/src/main.rs index 2ae37e2c..0f0d980b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -170,6 +170,8 @@ fn main() { })) = opts.command { commands::list_sessions(no_formatting, short); + } else if let Some(Command::Sessions(Sessions::ListAliases)) = opts.command { + commands::list_aliases(opts); } else if let Some(Command::Sessions(Sessions::KillAllSessions { yes })) = opts.command { commands::kill_all_sessions(yes); } else if let Some(Command::Sessions(Sessions::KillSession { ref target_session })) = |
