Document every client command in the manual page (#441)

This commit is contained in:
VAWVAW 2025-06-05 04:57:06 +00:00 committed by GitHub
parent c420c9dd65
commit a9cb5608f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 51 additions and 21 deletions

View file

@ -54,7 +54,7 @@ version and quit.
View a list of joined rooms and direct messages. View a list of joined rooms and direct messages.
.It Sy ":dms" .It Sy ":dms"
View a list of direct messages. View a list of direct messages.
.It Sy ":logout" .It Sy ":logout [user id]"
Log out of Log out of
.Nm . .Nm .
.It Sy ":rooms" .It Sy ":rooms"
@ -63,6 +63,8 @@ View a list of joined rooms.
View a list of joined spaces. View a list of joined spaces.
.It Sy ":unreads" .It Sy ":unreads"
View a list of unread rooms. View a list of unread rooms.
.It Sy ":unreads clear"
Mark all rooms as read.
.It Sy ":welcome" .It Sy ":welcome"
View the startup Welcome window. View the startup Welcome window.
.El .El
@ -77,39 +79,56 @@ Import and decrypt keys from
.Pa path . .Pa path .
.It Sy ":verify" .It Sy ":verify"
View a list of ongoing E2EE verifications. View a list of ongoing E2EE verifications.
.It Sy ":verify accept [key]"
Accept a verification request.
.It Sy ":verify cancel [key]"
Cancel an in-progress verification.
.It Sy ":verify confirm [key]"
Confirm an in-progress verification.
.It Sy ":verify mismatch [key]"
Reject an in-progress verification due to mismatched Emoji.
.It Sy ":verify request [user id]"
Request a new verification with the specified user.
.El .El
.Sh "MESSAGE COMMANDS" .Sh "MESSAGE COMMANDS"
.Bl -tag -width Ds .Bl -tag -width Ds
.It Sy ":download" .It Sy ":download [path]"
Download an attachment from the selected message. Download an attachment from the selected message and save it to the optional path.
.It Sy ":open [path]"
Download and then open an attachment, or open a link in a message.
.It Sy ":edit" .It Sy ":edit"
Edit the selected message. Edit the selected message.
.It Sy ":editor" .It Sy ":editor"
Open an external Open an external
.Ev $EDITOR .Ev $EDITOR
to compose a message. to compose a message.
.It Sy ":open"
Download and then open an attachment, or open a link in a message.
.It Sy ":react [shortcode]" .It Sy ":react [shortcode]"
React to the selected message with an Emoji. React to the selected message with an Emoji.
.It Sy ":redact [reason]"
Redact the selected message.
.It Sy ":reply"
Reply to the selected message.
.It Sy ":unreads clear"
Mark all unread rooms as read.
.It Sy ":unreact [shortcode]" .It Sy ":unreact [shortcode]"
Remove your reaction from the selected message. Remove your reaction from the selected message.
When no arguments are given, remove all of your reactions from the message. When no arguments are given, remove all of your reactions from the message.
.It Sy ":upload" .It Sy ":redact [reason]"
Redact the selected message with the optional reason.
.It Sy ":reply"
Reply to the selected message.
.It Sy ":cancel"
Cancel the currently drafted message including replies.
.It Sy ":unreads clear"
Mark all unread rooms as read.
.It Sy ":upload [path]"
Upload an attachment and send it to the currently selected room. Upload an attachment and send it to the currently selected room.
.El .El
.Sh "ROOM COMMANDS" .Sh "ROOM COMMANDS"
.Bl -tag -width Ds .Bl -tag -width Ds
.It Sy ":create" .It Sy ":create [arguments]"
Create a new room. Create a new room. Arguments can be
.Dq ++alias=[alias] ,
.Dq ++public ,
.Dq ++space ,
and
.Dq ++encrypted .
.It Sy ":invite accept" .It Sy ":invite accept"
Accept an invitation to the currently focused room. Accept an invitation to the currently focused room.
.It Sy ":invite reject" .It Sy ":invite reject"
@ -117,7 +136,7 @@ Reject an invitation to the currently focused room.
.It Sy ":invite send [user]" .It Sy ":invite send [user]"
Send an invitation to a user to join the currently focused room. Send an invitation to a user to join the currently focused room.
.It Sy ":join [room]" .It Sy ":join [room]"
Join a room. Join a room or open it if you are already joined.
.It Sy ":leave" .It Sy ":leave"
Leave the currently focused room. Leave the currently focused room.
.It Sy ":members" .It Sy ":members"
@ -126,6 +145,10 @@ View a list of members of the currently focused room.
Set the name of the currently focused room. Set the name of the currently focused room.
.It Sy ":room name unset" .It Sy ":room name unset"
Unset the name of the currently focused room. Unset the name of the currently focused room.
.It Sy ":room dm set"
Mark the currently focused room as a direct message.
.It Sy ":room dm unset"
Mark the currently focused room as a normal room.
.It Sy ":room notify set [level]" .It Sy ":room notify set [level]"
Set a notification level for the currently focused room. Set a notification level for the currently focused room.
Valid levels are Valid levels are
@ -153,6 +176,8 @@ Remove a tag from the currently focused room.
Set the topic of the currently focused room. Set the topic of the currently focused room.
.It Sy ":room topic unset" .It Sy ":room topic unset"
Unset the topic of the currently focused room. Unset the topic of the currently focused room.
.It Sy ":room topic show"
Show the topic of the currently focused room.
.It Sy ":room alias set [alias]" .It Sy ":room alias set [alias]"
Create and point the given alias to the room. Create and point the given alias to the room.
.It Sy ":room alias unset [alias]" .It Sy ":room alias unset [alias]"
@ -177,8 +202,12 @@ Kick a user from this room with an optional reason.
.Sh "SPACE COMMANDS" .Sh "SPACE COMMANDS"
.Bl -tag -width Ds .Bl -tag -width Ds
.It Sy ":space child set [room_id]" .It Sy ":space child set [room_id] [arguments]"
Add a room to the currently focused space. Add a room to the currently focused space.
.Dq ++suggested
marks the room as a suggested child.
.Dq ++order=[string]
specifies a string by which children are lexicographically ordered.
.It Sy ":space child remove" .It Sy ":space child remove"
Remove the selected room from the currently focused space. Remove the selected room from the currently focused space.
.El .El

View file

@ -484,6 +484,10 @@ fn iamb_room(desc: CommandDescription, ctx: &mut ProgContext) -> ProgResult {
("tag", "set", Some(s)) => RoomAction::Set(RoomField::Tag(tag_name(s)?), "".into()).into(), ("tag", "set", Some(s)) => RoomAction::Set(RoomField::Tag(tag_name(s)?), "".into()).into(),
("tag", "set", None) => return Result::Err(CommandError::InvalidArgument), ("tag", "set", None) => return Result::Err(CommandError::InvalidArgument),
// :room tag unset <tag-name>
("tag", "unset", Some(s)) => RoomAction::Unset(RoomField::Tag(tag_name(s)?)).into(),
("tag", "unset", None) => return Result::Err(CommandError::InvalidArgument),
// :room notify set <notification-level> // :room notify set <notification-level>
("notify", "set", Some(s)) => RoomAction::Set(RoomField::NotificationMode, s).into(), ("notify", "set", Some(s)) => RoomAction::Set(RoomField::NotificationMode, s).into(),
("notify", "set", None) => return Result::Err(CommandError::InvalidArgument), ("notify", "set", None) => return Result::Err(CommandError::InvalidArgument),
@ -496,10 +500,6 @@ fn iamb_room(desc: CommandDescription, ctx: &mut ProgContext) -> ProgResult {
("notify", "show", None) => RoomAction::Show(RoomField::NotificationMode).into(), ("notify", "show", None) => RoomAction::Show(RoomField::NotificationMode).into(),
("notify", "show", Some(_)) => return Result::Err(CommandError::InvalidArgument), ("notify", "show", Some(_)) => return Result::Err(CommandError::InvalidArgument),
// :room tag unset <tag-name>
("tag", "unset", Some(s)) => RoomAction::Unset(RoomField::Tag(tag_name(s)?)).into(),
("tag", "unset", None) => return Result::Err(CommandError::InvalidArgument),
// :room aliases show // :room aliases show
("alias", "show", None) => RoomAction::Show(RoomField::Aliases).into(), ("alias", "show", None) => RoomAction::Show(RoomField::Aliases).into(),
("alias", "show", Some(_)) => return Result::Err(CommandError::InvalidArgument), ("alias", "show", Some(_)) => return Result::Err(CommandError::InvalidArgument),
@ -563,13 +563,14 @@ fn iamb_space(desc: CommandDescription, ctx: &mut ProgContext) -> ProgResult {
}; };
let act: IambAction = match (field.as_str(), action.as_str()) { let act: IambAction = match (field.as_str(), action.as_str()) {
// :space child remove
("child", "remove") => { ("child", "remove") => {
if !(args.is_empty()) { if !(args.is_empty()) {
return Err(CommandError::InvalidArgument); return Err(CommandError::InvalidArgument);
} }
SpaceAction::RemoveChild.into() SpaceAction::RemoveChild.into()
}, },
// :space child set // :space child set <child>
("child", "set") => { ("child", "set") => {
let mut order = None; let mut order = None;
let mut suggested = false; let mut suggested = false;