add command to list features

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-07-24 23:53:48 +00:00
parent 8bb69eb81d
commit 4e975887cf
2 changed files with 61 additions and 1 deletions

View file

@ -14,6 +14,18 @@ pub(super) enum ServerCommand {
/// - Show configuration values
ShowConfig,
/// - List the features built into the server
ListFeatures {
#[arg(short, long)]
available: bool,
#[arg(short, long)]
enabled: bool,
#[arg(short, long)]
comma: bool,
},
/// - Print database memory usage statistics
MemoryUsage,
@ -54,6 +66,11 @@ pub(super) async fn process(command: ServerCommand, body: Vec<&str>) -> Result<R
Ok(match command {
ServerCommand::Uptime => uptime(body).await?,
ServerCommand::ShowConfig => show_config(body).await?,
ServerCommand::ListFeatures {
available,
enabled,
comma,
} => list_features(body, available, enabled, comma).await?,
ServerCommand::MemoryUsage => memory_usage(body).await?,
ServerCommand::ClearCaches => clear_caches(body).await?,
ServerCommand::ListBackups => list_backups(body).await?,