From 06a8c9024787cc13acfb4ae2b0666d3adaf87274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Sat, 21 Nov 2020 13:55:36 +0100 Subject: print status of mute/deafened when they change --- mumctl/src/main.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'mumctl/src') diff --git a/mumctl/src/main.rs b/mumctl/src/main.rs index 9b5a018..3bdaab3 100644 --- a/mumctl/src/main.rs +++ b/mumctl/src/main.rs @@ -289,7 +289,15 @@ fn main() { } else { unreachable!() }); - err_print!(send_command(command)); + match send_command(command) { + Ok(Some(CommandResponse::MuteStatus { is_muted })) => println!("{}", if is_muted { + "Muted" + } else { + "Unmuted" + }), + Ok(_) => {}, + Err(e) => println!("{} {}", "error".red(), e), + } } else if let Some(matches) = matches.subcommand_matches("deafen") { let command = Command::DeafenSelf(if let Some(_matches) = matches.subcommand_matches("true") { @@ -301,7 +309,15 @@ fn main() { } else { unreachable!() }); - err_print!(send_command(command)); + match send_command(command) { + Ok(Some(CommandResponse::DeafenStatus { is_deafened })) => println!("{}", if is_deafened { + "Deafened" + } else { + "Undeafened" + }), + Ok(_) => {}, + Err(e) => println!("{} {}", "error".red(), e), + } } else if let Some(matches) = matches.subcommand_matches("user") { let name = matches.value_of("user").unwrap(); if let Some(matches) = matches.subcommand_matches("mute") { -- cgit v1.2.1