feat(cli): rooms and chat subcommands

Add `rooms` (list public rooms with user counts, busiest first) and
`chat <room> [message]` (join a room; say a message and exit, or listen
and print incoming messages/joins/leaves for a while). Factor a shared
connect_and_login helper.
This commit is contained in:
michel
2026-07-19 19:49:17 +02:00
parent 7bc0ee2c3d
commit 7d94b2caa3
2 changed files with 139 additions and 0 deletions
+16
View File
@@ -104,6 +104,22 @@ pub enum Commands {
/// Username whose shares to list
username: String,
},
/// List the public chat rooms and their user counts
Rooms,
/// Join a chat room: print messages, or send one and exit
Chat {
/// Name of the room to join
room: String,
/// Optional message to say in the room (omit to just listen)
message: Option<String>,
/// Seconds to stay and print incoming messages when only listening
#[arg(short, long, default_value = "30")]
listen_secs: u64,
},
}
pub fn parse_server_address(server: &str) -> color_eyre::Result<(String, u16)> {