-
Notifications
You must be signed in to change notification settings - Fork 122
Expand file tree
/
Copy pathmod.rs
More file actions
89 lines (70 loc) · 1.62 KB
/
mod.rs
File metadata and controls
89 lines (70 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
mod alias;
mod commands;
mod directory;
mod info;
mod moderation;
use clap::Subcommand;
use ruma::OwnedRoomId;
use tuwunel_core::Result;
use self::{
alias::RoomAliasCommand, directory::RoomDirectoryCommand, info::RoomInfoCommand,
moderation::RoomModerationCommand,
};
use crate::admin_command_dispatch;
#[admin_command_dispatch(handler_prefix = "room")]
#[derive(Debug, Subcommand)]
pub(super) enum RoomCommand {
/// - List all rooms the server knows about
List {
page: Option<usize>,
/// Excludes rooms that we have federation disabled with
#[arg(long)]
exclude_disabled: bool,
/// 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)]
/// - View information about a room we know about
Info(RoomInfoCommand),
#[command(subcommand)]
/// - Manage moderation of remote or local rooms
Moderation(RoomModerationCommand),
#[command(subcommand)]
/// - Manage room aliases
Alias(RoomAliasCommand),
#[command(subcommand)]
/// - Manage the room directory
Directory(RoomDirectoryCommand),
/// - Check if we know about a room
Exists {
room_id: OwnedRoomId,
},
/// - Delete room
Delete {
room_id: OwnedRoomId,
#[arg(short, long)]
force: bool,
},
/// - Prune empty rooms
PruneEmpty {
#[arg(short, long)]
force: bool,
},
/// - Delete rooms
DeleteRooms {
#[arg(long)]
page: Option<usize>,
room_index: Vec<usize>,
#[arg(short, long)]
force: bool,
#[arg(long)]
exclude_disabled: bool,
#[arg(long)]
exclude_banned: bool,
},
}