summaryrefslogtreecommitdiffstats
path: root/src/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands.rs')
-rw-r--r--src/commands.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/commands.rs b/src/commands.rs
index cde96b127..f27f0c550 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);
+}