unconditionally derive Debug on subcommand enums

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-07-24 00:13:03 +00:00
parent f841c2356d
commit 2468e0c3de
11 changed files with 24 additions and 47 deletions

View File

@ -8,7 +8,7 @@ use crate::{
server, server::ServerCommand, user, user::UserCommand,
};
#[derive(Parser)]
#[derive(Debug, Parser)]
#[command(name = "admin", version = env!("CARGO_PKG_VERSION"))]
pub(crate) enum AdminCommand {
#[command(subcommand)]

View File

@ -6,8 +6,7 @@ use ruma::events::room::message::RoomMessageEventContent;
use self::commands::*;
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
pub(super) enum AppserviceCommand {
/// - Register an appservice using its registration YAML
///

View File

@ -6,8 +6,7 @@ use ruma::events::room::message::RoomMessageEventContent;
use self::commands::*;
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
pub(super) enum CheckCommand {
AllUsers,
}

View File

@ -8,8 +8,7 @@ use tester::TesterCommand;
use self::commands::*;
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
pub(super) enum DebugCommand {
/// - Echo input of admin command
Echo {

View File

@ -2,8 +2,7 @@ use ruma::events::room::message::RoomMessageEventContent;
use crate::Result;
#[derive(clap::Subcommand)]
#[cfg_attr(test, derive(Debug))]
#[derive(Debug, clap::Subcommand)]
pub(crate) enum TesterCommand {
Tester,
Timer,

View File

@ -6,8 +6,7 @@ use ruma::{events::room::message::RoomMessageEventContent, RoomId, ServerName, U
use self::commands::*;
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
pub(super) enum FederationCommand {
/// - List all rooms we are currently handling an incoming pdu from
IncomingFederation,

View File

@ -6,8 +6,7 @@ use ruma::{events::room::message::RoomMessageEventContent, EventId, MxcUri};
use self::commands::*;
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
pub(super) enum MediaCommand {
/// - Deletes a single media file from our database and on the filesystem
/// via a single MXC URL

View File

@ -21,8 +21,7 @@ use self::{
room_alias::room_alias, sending::sending, users::users,
};
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
/// Query tables from database
pub(super) enum QueryCommand {
/// - account_data.rs iterators and getters
@ -62,8 +61,7 @@ pub(super) enum QueryCommand {
Resolver(Resolver),
}
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
/// All the getters and iterators from src/database/key_value/account_data.rs
pub(super) enum AccountData {
/// - Returns all changes to the account data that happened after `since`.
@ -87,8 +85,7 @@ pub(super) enum AccountData {
},
}
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
/// All the getters and iterators from src/database/key_value/appservice.rs
pub(super) enum Appservice {
/// - Gets the appservice registration info/details from the ID as a string
@ -101,8 +98,7 @@ pub(super) enum Appservice {
All,
}
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
/// All the getters and iterators from src/database/key_value/presence.rs
pub(super) enum Presence {
/// - Returns the latest presence event for the given user.
@ -119,8 +115,7 @@ pub(super) enum Presence {
},
}
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
/// All the getters and iterators from src/database/key_value/rooms/alias.rs
pub(super) enum RoomAlias {
ResolveLocalAlias {
@ -138,8 +133,7 @@ pub(super) enum RoomAlias {
AllLocalAliases,
}
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
pub(super) enum RoomStateCache {
ServerInRoom {
server: Box<ServerName>,
@ -210,8 +204,7 @@ pub(super) enum RoomStateCache {
},
}
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
/// All the getters and iterators from src/database/key_value/globals.rs
pub(super) enum Globals {
DatabaseVersion,
@ -229,8 +222,7 @@ pub(super) enum Globals {
},
}
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
/// All the getters and iterators from src/database/key_value/sending.rs
pub(super) enum Sending {
/// - Queries database for all `servercurrentevent_data`
@ -285,15 +277,13 @@ pub(super) enum Sending {
},
}
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
/// All the getters and iterators from src/database/key_value/users.rs
pub(super) enum Users {
Iter,
}
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
/// Resolver service and caches
pub(super) enum Resolver {
/// Query the destinations cache

View File

@ -10,8 +10,7 @@ use ruma::{events::room::message::RoomMessageEventContent, RoomId, RoomOrAliasId
use self::room_commands::list;
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
pub(super) enum RoomCommand {
/// - List all rooms the server knows about
List {
@ -43,8 +42,7 @@ pub(super) enum RoomCommand {
Directory(RoomDirectoryCommand),
}
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
pub(super) enum RoomInfoCommand {
/// - List joined members in a room
ListJoinedMembers {
@ -60,8 +58,7 @@ pub(super) enum RoomInfoCommand {
},
}
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
pub(super) enum RoomAliasCommand {
/// - Make an alias point to a room.
Set {
@ -96,8 +93,7 @@ pub(super) enum RoomAliasCommand {
},
}
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
pub(super) enum RoomDirectoryCommand {
/// - Publish a room to the room directory
Publish {
@ -117,8 +113,7 @@ pub(super) enum RoomDirectoryCommand {
},
}
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
pub(super) enum RoomModerationCommand {
/// - Bans a room from local users joining and evicts all our local users
/// from the room. Also blocks any invites (local and remote) for the

View File

@ -6,8 +6,7 @@ use ruma::events::room::message::RoomMessageEventContent;
use self::commands::*;
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
pub(super) enum ServerCommand {
/// - Time elapsed since startup
Uptime,

View File

@ -6,8 +6,7 @@ use ruma::{events::room::message::RoomMessageEventContent, OwnedRoomOrAliasId, R
use self::commands::*;
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
#[derive(Debug, Subcommand)]
pub(super) enum UserCommand {
/// - Create a new user
Create {