diff --git a/src/admin/room/commands.rs b/src/admin/room/commands.rs index fff5e5b6..2adfa7d7 100644 --- a/src/admin/room/commands.rs +++ b/src/admin/room/commands.rs @@ -5,7 +5,7 @@ use crate::{admin_command, get_room_info, PAGE_SIZE}; #[admin_command] pub(super) async fn list_rooms( - &self, page: Option, exclude_disabled: bool, exclude_banned: bool, + &self, page: Option, exclude_disabled: bool, exclude_banned: bool, no_details: bool, ) -> Result { // TODO: i know there's a way to do this with clap, but i can't seem to find it let page = page.unwrap_or(1); @@ -63,7 +63,11 @@ pub(super) async fn list_rooms( rooms.len(), rooms .iter() - .map(|(id, members, name)| format!("{id}\tMembers: {members}\tName: {name}")) + .map(|(id, members, name)| if no_details { + format!("{id}") + } else { + format!("{id}\tMembers: {members}\tName: {name}") + }) .collect::>() .join("\n") ); diff --git a/src/admin/room/mod.rs b/src/admin/room/mod.rs index da7acb80..64d2af45 100644 --- a/src/admin/room/mod.rs +++ b/src/admin/room/mod.rs @@ -27,6 +27,11 @@ pub(super) enum RoomCommand { /// Excludes rooms that we have banned #[arg(long)] exclude_banned: bool, + + #[arg(long)] + /// Whether to only output room IDs without supplementary room + /// information + no_details: bool, }, #[command(subcommand)]