aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG6
-rw-r--r--documentation/mumctl.126
-rw-r--r--documentation/mumctl.txt16
-rw-r--r--documentation/mumd.14
-rw-r--r--documentation/mumdrc.54
-rw-r--r--mumctl/src/main.rs109
6 files changed, 74 insertions, 91 deletions
diff --git a/CHANGELOG b/CHANGELOG
index c1e7b5f..b13aca1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -22,8 +22,10 @@ Added
* --version now includes the current commit hash.
* Server passwords. Thanks @rbran!
-// Changed
-// ~~~~~~~
+Changed
+~~~~~~~
+
+* Changed how you mute yourself/others. See man pages for details on the new options.
// Removed
// ~~~~~~~
diff --git a/documentation/mumctl.1 b/documentation/mumctl.1
index 3239cb4..2752ad6 100644
--- a/documentation/mumctl.1
+++ b/documentation/mumctl.1
@@ -2,12 +2,12 @@
.\" Title: mumd
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.12
-.\" Date: 2020-12-25
+.\" Date: 2021-03-29
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "MUMCTL" "1" "2020-12-25" "\ \&" "\ \&"
+.TH "MUMCTL" "1" "2021-03-29" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -84,9 +84,9 @@ as well).
If omitted, the port defaults to 64738.
.RE
.sp
-mumctl deafen <true|false|toggle>
+mumctl deafen
.RS 4
-Deafen/undeafen yourself.
+Deafen yourself.
.RE
.sp
mumctl disconnect
@@ -99,6 +99,12 @@ mumctl help
Show a help message.
.RE
.sp
+mumctl mute [user]
+.RS 4
+Mute yourself or someone else.
+If user is omitted, you mute yourself. Otherwise, the user with the username [user] is muted.
+.RE
+.sp
mumctl server add [\-\-password <password>] [\-\-port <port>] [\-\-username <username>] [<name>] <host>
.RS 4
Add a saved server configuration.
@@ -129,9 +135,15 @@ mumctl status
Show the currently conneced channel and server.
.RE
.sp
-mumctl user <name> mute <true|false|toggle>
+mumctl undeafen
+.RS 4
+Undeafen yourself.
+.RE
+.sp
+mumctl unmute [user]
.RS 4
-Mute someone else locally.
+Unmute yourself or someone else.
+If user is omitted, unmute yourself. Otherwise, the user with the username [user] is unmuted.
.RE
.sp
mumctl volume set <volume>
@@ -156,4 +168,4 @@ or by e\-mail to \c
.MTO "gustav\(atsornas.net" "" "."
.SH "SEE ALSO"
.sp
-mumd(1), mumdrc(5) \ No newline at end of file
+mumd(1), mumdrc(5)
diff --git a/documentation/mumctl.txt b/documentation/mumctl.txt
index 10c325f..5b1607c 100644
--- a/documentation/mumctl.txt
+++ b/documentation/mumctl.txt
@@ -52,8 +52,8 @@ mumctl connect [-p|--port <port>] <host> [username] ::
as well).
If omitted, the port defaults to 64738.
-mumctl deafen <true|false|toggle> ::
- Deafen/undeafen yourself.
+mumctl deafen ::
+ Deafen yourself.
mumctl disconnect ::
Disconnect from the currently connected server.
@@ -61,6 +61,10 @@ mumctl disconnect ::
mumctl help ::
Show a help message.
+mumctl mute [user] ::
+ Mute yourself or someone else.
+ If user is omitted, you mute yourself. Otherwise, the user with the username [user] is muted.
+
mumctl server add [--password <password>] [--port <port>] [--username <username>] [<name>] <host> ::
Add a saved server configuration.
@@ -79,8 +83,12 @@ mumctl server rename <old name> <new name> ::
mumctl status ::
Show the currently conneced channel and server.
-mumctl user <name> mute <true|false|toggle> ::
- Mute someone else locally.
+mumctl undeafen ::
+ Undeafen yourself.
+
+mumctl unmute [user] ::
+ Unmute yourself or someone else.
+ If user is omitted, unmute yourself. Otherwise, the user with the username [user] is unmuted.
mumctl volume set <volume> ::
Set the outgoing volume level.
diff --git a/documentation/mumd.1 b/documentation/mumd.1
index ffd5f96..9a26720 100644
--- a/documentation/mumd.1
+++ b/documentation/mumd.1
@@ -2,12 +2,12 @@
.\" Title: mumd
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.12
-.\" Date: 2020-12-25
+.\" Date: 2021-01-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "MUMD" "1" "2020-12-25" "\ \&" "\ \&"
+.TH "MUMD" "1" "2021-01-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/documentation/mumdrc.5 b/documentation/mumdrc.5
index b540f1b..88bb748 100644
--- a/documentation/mumdrc.5
+++ b/documentation/mumdrc.5
@@ -2,12 +2,12 @@
.\" Title: mumdrc
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.12
-.\" Date: 2020-12-25
+.\" Date: 2021-01-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "MUMDRC" "5" "2020-12-25" "\ \&" "\ \&"
+.TH "MUMDRC" "5" "2021-01-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/mumctl/src/main.rs b/mumctl/src/main.rs
index 45ee126..298c04f 100644
--- a/mumctl/src/main.rs
+++ b/mumctl/src/main.rs
@@ -160,32 +160,21 @@ fn main() {
)
.subcommand(
SubCommand::with_name("mute")
- .about("Mute/unmute yourself")
- .subcommand(SubCommand::with_name("true").alias("1"))
- .subcommand(SubCommand::with_name("false").alias("0"))
- .subcommand(SubCommand::with_name("toggle"))
- .setting(AppSettings::SubcommandRequiredElseHelp),
+ .about("Mute someone/yourself")
+ .arg(Arg::with_name("user"))
+ )
+ .subcommand(
+ SubCommand::with_name("unmute")
+ .about("Unmute someone/yourself")
+ .arg(Arg::with_name("user"))
)
.subcommand(
SubCommand::with_name("deafen")
- .about("Deafen/undeafen yourself")
- .subcommand(SubCommand::with_name("true").alias("1"))
- .subcommand(SubCommand::with_name("false").alias("0"))
- .subcommand(SubCommand::with_name("toggle"))
- .setting(AppSettings::SubcommandRequiredElseHelp),
+ .about("Deafen yourself")
)
.subcommand(
- SubCommand::with_name("user")
- .about("Configure someone else")
- .arg(Arg::with_name("user").required(true))
- .subcommand(
- SubCommand::with_name("mute")
- .subcommand(SubCommand::with_name("true").alias("1"))
- .subcommand(SubCommand::with_name("false").alias("0"))
- .subcommand(SubCommand::with_name("toggle"))
- .setting(AppSettings::SubcommandRequiredElseHelp),
- )
- .setting(AppSettings::SubcommandRequiredElseHelp),
+ SubCommand::with_name("undeafen")
+ .about("Undeafen yourself")
);
let matches = app.clone().get_matches();
@@ -328,62 +317,34 @@ fn process_matches(matches: ArgMatches, config: &mut Config, app: &mut App) -> R
//needs work on mumd to implement
}
} else if let Some(matches) = matches.subcommand_matches("mute") {
- let command =
- Command::MuteSelf(if let Some(_matches) = matches.subcommand_matches("true") {
- Some(true)
- } else if let Some(_matches) = matches.subcommand_matches("false") {
- Some(false)
- } else if let Some(_matches) = matches.subcommand_matches("toggle") {
- None
- } else {
- unreachable!()
- });
- match send_command(command)? {
- Ok(Some(CommandResponse::MuteStatus { is_muted })) => println!("{}", if is_muted {
- "Muted"
- } else {
- "Unmuted"
- }),
- Ok(_) => {},
- Err(e) => error!("{}", e),
- }
- } else if let Some(matches) = matches.subcommand_matches("deafen") {
- let command =
- Command::DeafenSelf(if let Some(_matches) = matches.subcommand_matches("true") {
- Some(true)
- } else if let Some(_matches) = matches.subcommand_matches("false") {
- Some(false)
- } else if let Some(_matches) = matches.subcommand_matches("toggle") {
- None
- } else {
- unreachable!()
- });
- match send_command(command)? {
- Ok(Some(CommandResponse::DeafenStatus { is_deafened })) => println!("{}", if is_deafened {
- "Deafened"
- } else {
- "Undeafened"
- }),
- Ok(_) => {},
- Err(e) => error!("{}", e),
+ let command = if let Some(user) = matches.value_of("user") {
+ Command::MuteOther(user.to_string(), Some(true))
+ } else {
+ Command::MuteSelf(Some(true))
+ };
+ if let Err(e) = send_command(command)? {
+ error!("{}", 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") {
- let toggle = if let Some(_matches) = matches.subcommand_matches("true") {
- Some(true)
- } else if let Some(_matches) = matches.subcommand_matches("false") {
- Some(false)
- } else if let Some(_matches) = matches.subcommand_matches("toggle") {
- None
- } else {
- unreachable!()
- };
- error_if_err!(send_command(Command::MuteOther(name.to_string(), toggle)));
+ } else if let Some(matches) = matches.subcommand_matches("unmute") {
+ let command = if let Some(user) = matches.value_of("user") {
+ Command::MuteOther(user.to_string(), Some(false))
} else {
- unreachable!();
+ Command::MuteSelf(Some(false))
+ };
+ if let Err(e) = send_command(command)? {
+ error!("{}", e);
}
- };
+ } else if let Some(_) = matches.subcommand_matches("deafen") {
+ if let Err(e) = send_command(Command::DeafenSelf(Some(true)))? {
+ error!("{}", e);
+ }
+ } else if let Some(_) = matches.subcommand_matches("undeafen") {
+ if let Err(e) = send_command(Command::DeafenSelf(Some(false)))? {
+ error!("{}", e);
+ }
+ } else {
+ unreachable!();
+ }
Ok(())
}