diff options
| author | Eskil Queseth <eskilq@kth.se> | 2020-10-21 02:24:16 +0200 |
|---|---|---|
| committer | Eskil Queseth <eskilq@kth.se> | 2020-10-21 04:28:17 +0200 |
| commit | d215385473f5380a1166101596e135ec6ede5501 (patch) | |
| tree | f5a76bfe19e01da3250f380021ce9b111c95023a /mumctl | |
| parent | 46a53f38cde86439a2ca8b6d24887f842530f679 (diff) | |
| download | mum-d215385473f5380a1166101596e135ec6ede5501.tar.gz | |
add printing of welcome message to server connect
Diffstat (limited to 'mumctl')
| -rw-r--r-- | mumctl/src/main.rs | 16 |
1 files changed, 14 insertions, 2 deletions
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); + } + }; } } |
