2024-06-16 22:26:52 +00:00
|
|
|
mod commands;
|
2024-04-20 19:13:18 -04:00
|
|
|
|
|
|
|
|
use clap::Subcommand;
|
2024-12-14 21:58:01 -05:00
|
|
|
use conduwuit::Result;
|
2024-04-20 19:13:18 -04:00
|
|
|
|
2024-07-27 00:11:41 +00:00
|
|
|
use crate::admin_command_dispatch;
|
2024-04-20 19:13:18 -04:00
|
|
|
|
2024-07-27 00:11:41 +00:00
|
|
|
#[admin_command_dispatch]
|
2024-07-24 00:13:03 +00:00
|
|
|
#[derive(Debug, Subcommand)]
|
2024-06-16 22:26:52 +00:00
|
|
|
pub(super) enum ServerCommand {
|
2024-04-26 18:55:45 -07:00
|
|
|
/// - Time elapsed since startup
|
|
|
|
|
Uptime,
|
|
|
|
|
|
2024-04-20 19:13:18 -04:00
|
|
|
/// - Show configuration values
|
|
|
|
|
ShowConfig,
|
|
|
|
|
|
2024-07-24 23:53:48 +00:00
|
|
|
/// - List the features built into the server
|
|
|
|
|
ListFeatures {
|
|
|
|
|
#[arg(short, long)]
|
|
|
|
|
available: bool,
|
|
|
|
|
|
|
|
|
|
#[arg(short, long)]
|
|
|
|
|
enabled: bool,
|
|
|
|
|
|
|
|
|
|
#[arg(short, long)]
|
|
|
|
|
comma: bool,
|
|
|
|
|
},
|
|
|
|
|
|
2024-04-20 19:13:18 -04:00
|
|
|
/// - Print database memory usage statistics
|
|
|
|
|
MemoryUsage,
|
|
|
|
|
|
2024-07-04 03:26:19 +00:00
|
|
|
/// - Clears all of Conduwuit's caches
|
|
|
|
|
ClearCaches,
|
2024-04-20 19:13:18 -04:00
|
|
|
|
|
|
|
|
/// - Performs an online backup of the database (only available for RocksDB
|
|
|
|
|
/// at the moment)
|
|
|
|
|
BackupDatabase,
|
|
|
|
|
|
|
|
|
|
/// - List database backups
|
|
|
|
|
ListBackups,
|
|
|
|
|
|
|
|
|
|
/// - List database files
|
|
|
|
|
ListDatabaseFiles,
|
2024-06-16 01:44:41 +00:00
|
|
|
|
2024-06-16 02:10:47 +00:00
|
|
|
/// - Send a message to the admin room.
|
|
|
|
|
AdminNotice {
|
|
|
|
|
message: Vec<String>,
|
|
|
|
|
},
|
|
|
|
|
|
2024-06-16 01:44:41 +00:00
|
|
|
/// - Hot-reload the server
|
2024-07-27 00:11:41 +00:00
|
|
|
#[clap(alias = "reload")]
|
|
|
|
|
ReloadMods,
|
2024-06-16 01:44:41 +00:00
|
|
|
|
2024-06-16 19:46:32 +00:00
|
|
|
#[cfg(unix)]
|
|
|
|
|
/// - Restart the server
|
2024-07-03 04:46:50 +00:00
|
|
|
Restart {
|
|
|
|
|
#[arg(short, long)]
|
|
|
|
|
force: bool,
|
|
|
|
|
},
|
2024-06-16 19:46:32 +00:00
|
|
|
|
2024-06-16 01:44:41 +00:00
|
|
|
/// - Shutdown the server
|
|
|
|
|
Shutdown,
|
2024-04-20 19:13:18 -04:00
|
|
|
}
|