diff options
author | Kunal Mohan <kunalmohan99@gmail.com> | 2021-04-29 15:25:55 +0530 |
---|---|---|
committer | Kunal Mohan <kunalmohan99@gmail.com> | 2021-05-04 20:48:16 +0530 |
commit | 9110e444b8ef2f96a0386b7c5e65283a2b5456c0 (patch) | |
tree | 8ee2bd3e08f0b8a3594a9de6ac942056042e315d /src/main.rs | |
parent | 42079f8d048fc2ec4dad9b135efb93e31cf2ecb6 (diff) |
remove Split, OpenFile and MoveFocus from CliArgs
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/src/main.rs b/src/main.rs index e8aa39f7d..e6edfdfdd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,7 @@ mod server; use client::{boundaries, layout, panes, start_client, tab}; use common::{command_is_executing, errors, os_input_output, pty_bus, screen, utils, wasm_vm}; use directories_next::ProjectDirs; -use server::{start_server, ServerInstruction}; +use server::start_server; use structopt::StructOpt; @@ -50,42 +50,11 @@ pub fn main() { } let opts = CliArgs::from_args(); - let config = match Config::try_from(&opts) { - Ok(config) => config, - Err(e) => { - eprintln!("There was an error in the config file:\n{}", e); - std::process::exit(1); - } - }; - if let Some(split_dir) = opts.split { - match split_dir { - 'h' => { - let os_input = get_client_os_input(); - os_input.connect_to_server(); - os_input.send_to_server(ServerInstruction::SplitHorizontally); - } - 'v' => { - let os_input = get_client_os_input(); - os_input.connect_to_server(); - os_input.send_to_server(ServerInstruction::SplitVertically); - } - _ => {} - }; - } else if opts.move_focus { - let os_input = get_client_os_input(); - os_input.connect_to_server(); - os_input.send_to_server(ServerInstruction::MoveFocus); - } else if let Some(file_to_open) = opts.open_file { - let os_input = get_client_os_input(); - os_input.connect_to_server(); - os_input.send_to_server(ServerInstruction::OpenFile(file_to_open)); - } else { - atomic_create_dir(ZELLIJ_TMP_DIR).unwrap(); - atomic_create_dir(ZELLIJ_TMP_LOG_DIR).unwrap(); - let server_os_input = get_server_os_input(); - let os_input = get_client_os_input(); - start(Box::new(os_input), opts, Box::new(server_os_input)); - } + atomic_create_dir(ZELLIJ_TMP_DIR).unwrap(); + atomic_create_dir(ZELLIJ_TMP_LOG_DIR).unwrap(); + let server_os_input = get_server_os_input(); + let os_input = get_client_os_input(); + start(Box::new(os_input), opts, Box::new(server_os_input)); } /// Start Zellij with the specified [`ClientOsApi`], [`ServerOsApi`] and command-line arguments. |