From d215385473f5380a1166101596e135ec6ede5501 Mon Sep 17 00:00:00 2001 From: Eskil Queseth Date: Wed, 21 Oct 2020 02:24:16 +0200 Subject: add printing of welcome message to server connect --- mumctl/src/main.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'mumctl') diff --git a/mumctl/src/main.rs b/mumctl/src/main.rs index 1ed48dc..c7b65aa 100644 --- a/mumctl/src/main.rs +++ b/mumctl/src/main.rs @@ -185,12 +185,24 @@ fn match_server_connect(matches : &clap::ArgMatches<>) { Some(Ok(v)) => Some(v), }; if let Some(port) = port { - err_print!(send_command(Command::ServerConnect { + match send_command(Command::ServerConnect { host: host.to_string(), port, username: username.to_string(), accept_invalid_cert: true, //TODO - })); + }) { + Ok(e) => { + if let Some(CommandResponse::ServerConnect { welcome_message }) = e { + println!("Connected to {}", host); + if let Some(message) = welcome_message { + println!("Welcome: {}", message); + } + } + } + Err(e) => { + println!("{} {}", "error:".red(), e); + } + }; } } -- cgit v1.2.1