diff options
author | Kunal Mohan <kunalmohan99@gmail.com> | 2021-05-22 15:45:47 +0530 |
---|---|---|
committer | Kunal Mohan <kunalmohan99@gmail.com> | 2021-05-22 22:19:50 +0530 |
commit | fa0a7e05c384f0da1a6fe3dd240181a6ff528b58 (patch) | |
tree | b188dbaefc080c0155475634c7427d8322fa5ef9 /src | |
parent | ac082a1c930a356253f5cb3b685aabe28f87cba6 (diff) |
Add ability to attach to sessions
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 15 | ||||
-rw-r--r-- | src/tests/fakes.rs | 1 | ||||
-rw-r--r-- | src/tests/mod.rs | 2 |
3 files changed, 16 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 82fc14d5e..319ad307d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,7 +50,20 @@ pub fn main() { process::exit(1); } }; - start_client(Box::new(os_input), opts, config); + if let Some(Command::Sessions(Sessions::Attach { + session_name, + force, + })) = opts.command.clone() + { + start_client( + Box::new(os_input), + opts, + config, + Some((session_name, force)), + ); + } else { + start_client(Box::new(os_input), opts, config, None); + } } } diff --git a/src/tests/fakes.rs b/src/tests/fakes.rs index c81e226ff..cb41821a3 100644 --- a/src/tests/fakes.rs +++ b/src/tests/fakes.rs @@ -300,6 +300,7 @@ impl ServerOsApi for FakeInputOutput { } fn add_client_sender(&self) {} fn remove_client_sender(&self) {} + fn send_to_temp_client(&self, _msg: ServerToClientMsg) {} fn update_receiver(&mut self, _stream: LocalSocketStream) {} fn load_palette(&self) -> Palette { default_palette() diff --git a/src/tests/mod.rs b/src/tests/mod.rs index 3e548db7c..f8a48a39f 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -21,6 +21,6 @@ pub fn start( start_server(server_os_input, PathBuf::from("")); }) .unwrap(); - start_client(client_os_input, opts, config); + start_client(client_os_input, opts, config, None); let _ = server_thread.join(); } |