From 79f2a2b4975a3ca76cadf76518157355e2ebd51c Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 1 Dec 2025 12:29:18 +0900 Subject: [PATCH] Add misc command help messages --- src/main.rs | 4 ++++ src/server/command.rs | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/main.rs b/src/main.rs index 9633db7..fa0bec5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -71,18 +71,22 @@ enum Command { #[command(flatten)] Client(client::commands::ClientCommand), + /// Run the server #[command(hide = true)] Server(server::command::ServerArgs), + /// Generate shell completions for the program. #[command(hide = true)] GenerateCompletions(GenerateCompletionArgs), } #[derive(Parser, Debug, Clone)] struct GenerateCompletionArgs { + /// Which shell to generate completions for. #[arg(long, default_value = "bash")] shell: Shell, + /// Which top-level command to generate completions for. #[arg(long, default_value = "muscl")] command: ToplevelCommands, } diff --git a/src/server/command.rs b/src/server/command.rs index 4b86855..6a0ae9d 100644 --- a/src/server/command.rs +++ b/src/server/command.rs @@ -12,18 +12,25 @@ pub struct ServerArgs { #[command(subcommand)] pub subcmd: ServerCommand, + /// Enable systemd mode #[arg(long)] pub systemd: bool, + /// Disable Landlock sandboxing. + /// + /// This is useful if you are planning to reload the server's configuration. #[arg(long)] pub disable_landlock: bool, } #[derive(Parser, Debug, Clone)] pub enum ServerCommand { + /// Start the server and listen for incoming connections on the unix socket + /// specified in the configuration file. #[command()] Listen, + /// Start the server using systemd socket activation. #[command()] SocketActivate, }