aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2022-10-05 07:44:00 +0200
committerGitHub <noreply@github.com>2022-10-05 07:44:00 +0200
commit79bf6ab868cbdab1f9a3827c9b70198f54548b44 (patch)
tree2d6fc4c1d8a79ebd727a1a5f8b6406617dd0de55 /src/main.rs
parentdocs(changelog): add darwin dependencies (diff)
downloadsl0ppij-79bf6ab868cbdab1f9a3827c9b70198f54548b44.tar.gz
sl0ppij-79bf6ab868cbdab1f9a3827c9b70198f54548b44.tar.xz
sl0ppij-79bf6ab868cbdab1f9a3827c9b70198f54548b44.zip
feat(config): switch to kdl (#1759)
* chore(config): default kdl keybindings config * tests * work * refactor(config): move stuff around * work * tab merge layout * work * work * layouts working * work * layout tests * work * work * feat(parsing): kdl layouts without config * refactor(kdl): move stuff around * work * tests(layout): add cases and fix bugs * work * fix(kdl): various bugs * chore(layouts): move all layouts to kdl * feat(kdl): shared keybidns * fix(layout): do not count fixed panes toward percentile * fix(keybinds): missing keybinds and actions * fix(config): adjust default tips * refactor(config): move stuff around * fix(tests): make e2e tests pass * fix(kdl): add verbose parsing errors * fix(kdl): focused tab * fix(layout): corret default_tab_template behavior * style(code): fix compile warnings * feat(cli): send actions through the cli * fix(cli): exit only when action is done * fix(cli): open embedded pane from floating pane * fix(cli): send actions to other sessions * feat(cli): command alias * feat(converter): convert old config * feat(converter): convert old layout and theme files * feat(kdl): pretty errors * feat(client): convert old YAML files on startup * fix: various bugs and styling issues * fix: e2e tests * fix(screen): propagate errors after merge * style(clippy): lower clippy level * fix(tests): own session_name variable * style(fmt): rustfmt * fix(cli): various action fixes * style(fmt): rustfmt * fix(themes): loading of theme files * style(fmt): rustfmt * fix(tests): theme fixtures * fix(layouts): better errors on unknown nodes * fix(kdl): clarify valid node terminator error * fix(e2e): adjust close tab test * fix(e2e): adjust close tab test again * style(code): cleanup some comments
Diffstat (limited to '')
-rw-r--r--src/main.rs51
1 files changed, 47 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index ca05dbf1..d2363e7b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -6,7 +6,7 @@ mod tests;
use zellij_utils::{
clap::Parser,
- cli::{CliArgs, Command, Sessions},
+ cli::{CliAction, CliArgs, Command, Sessions},
logging::*,
};
@@ -14,10 +14,53 @@ fn main() {
configure_logger();
let opts = CliArgs::parse();
- #[cfg(feature = "unstable")]
{
- if let Some(Command::Sessions(Sessions::Action { .. })) = opts.command {
- commands::send_action_to_session(opts);
+ if let Some(Command::Sessions(Sessions::Action(cli_action))) = opts.command {
+ commands::send_action_to_session(cli_action, opts.session);
+ std::process::exit(0);
+ }
+ if let Some(Command::Sessions(Sessions::Command {
+ command,
+ direction,
+ cwd,
+ floating,
+ })) = opts.command
+ {
+ let command_cli_action = CliAction::NewPane {
+ command,
+ direction,
+ cwd,
+ floating,
+ };
+ commands::send_action_to_session(command_cli_action, opts.session);
+ std::process::exit(0);
+ }
+ if let Some(Command::Sessions(Sessions::Edit {
+ file,
+ direction,
+ line_number,
+ floating,
+ })) = opts.command
+ {
+ let command_cli_action = CliAction::Edit {
+ file,
+ direction,
+ line_number,
+ floating,
+ };
+ commands::send_action_to_session(command_cli_action, opts.session);
+ std::process::exit(0);
+ }
+ if let Some(Command::Sessions(Sessions::ConvertConfig { old_config_file })) = opts.command {
+ commands::convert_old_config_file(old_config_file);
+ std::process::exit(0);
+ }
+ if let Some(Command::Sessions(Sessions::ConvertLayout { old_layout_file })) = opts.command {
+ commands::convert_old_layout_file(old_layout_file);
+ std::process::exit(0);
+ }
+ if let Some(Command::Sessions(Sessions::ConvertTheme { old_theme_file })) = opts.command {
+ commands::convert_old_theme_file(old_theme_file);
std::process::exit(0);
}
}