aboutsummaryrefslogtreecommitdiffstats
path: root/mumctl/src
diff options
context:
space:
mode:
Diffstat (limited to 'mumctl/src')
-rw-r--r--mumctl/src/main.rs16
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);
+ }
+ };
}
}