diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2020-11-21 13:55:36 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2020-11-21 16:20:04 +0100 |
| commit | 06a8c9024787cc13acfb4ae2b0666d3adaf87274 (patch) | |
| tree | 6ccc7ce5edfa57dee8749aa477de868ac3028106 /mumctl | |
| parent | a5448f67ca40a1619e7ef792dfbb5a440c3020e0 (diff) | |
| download | mum-06a8c9024787cc13acfb4ae2b0666d3adaf87274.tar.gz | |
print status of mute/deafened when they change
Diffstat (limited to 'mumctl')
| -rw-r--r-- | mumctl/src/main.rs | 20 |
1 files changed, 18 insertions, 2 deletions
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") { |
