mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-06-26 18:26:36 +02:00
The first part of getting admin command docs on the website. Next is is including it in the same way we do the example config or readme. There's also the beginnings of manpage generation here, although it's kinda sus and I'm not sure how it's supposed to work. I'll leave that to anyone who wants to package it. We introduce the beginings of the xtask pattern here - we do a lot of file generation, I thought it would be best to avoid doing that on every compilation. It also helps avoid lots of runtime deps. We'll need to document generating this stuff & probably add pre-commit hooks for it, though.
40 lines
1 KiB
Rust
40 lines
1 KiB
Rust
mod commands;
|
|
|
|
use clap::Subcommand;
|
|
use conduwuit::Result;
|
|
|
|
use crate::admin_command_dispatch;
|
|
|
|
#[derive(Debug, Subcommand)]
|
|
#[admin_command_dispatch]
|
|
pub enum AppserviceCommand {
|
|
/// - Register an appservice using its registration YAML
|
|
///
|
|
/// This command needs a YAML generated by an appservice (such as a bridge),
|
|
/// which must be provided in a Markdown code block below the command.
|
|
///
|
|
/// Registering a new bridge using the ID of an existing bridge will replace
|
|
/// the old one.
|
|
Register,
|
|
|
|
/// - Unregister an appservice using its ID
|
|
///
|
|
/// You can find the ID using the `list-appservices` command.
|
|
Unregister {
|
|
/// The appservice to unregister
|
|
appservice_identifier: String,
|
|
},
|
|
|
|
/// - Show an appservice's config using its ID
|
|
///
|
|
/// You can find the ID using the `list-appservices` command.
|
|
#[clap(alias("show"))]
|
|
ShowAppserviceConfig {
|
|
/// The appservice to show
|
|
appservice_identifier: String,
|
|
},
|
|
|
|
/// - List all the currently registered appservices
|
|
#[clap(alias("list"))]
|
|
ListRegistered,
|
|
}
|