From 96dbe56e3520b6921cf54dbfb2e83cf1813ef2eb Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 1 Dec 2025 20:28:03 +0900 Subject: [PATCH] Add ASCII banner + regards trailer to long help --- src/core/common.rs | 5 +++++ src/main.rs | 12 ++++++++++-- src/server/command.rs | 5 ++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/core/common.rs b/src/core/common.rs index 7890f30..1b44a82 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -19,6 +19,11 @@ pub const ASCII_BANNER: &str = indoc! { "# }; +pub const KIND_REGARDS: &str = concat!( + "Hacked together by yours truly, Programvareverkstedet \n", + "If you experience any bugs or turbulence, please give us a heads up :)", +); + #[derive(Debug, Clone)] pub struct UnixUser { pub username: String, diff --git a/src/main.rs b/src/main.rs index 1e7a5f6..479879f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ use futures_util::StreamExt; use crate::{ core::{ bootstrap::bootstrap_server_connection_and_drop_privileges, - common::executable_is_suid_or_sgid, + common::{ASCII_BANNER, KIND_REGARDS, executable_is_suid_or_sgid}, protocol::{Response, create_client_to_server_message_stream}, }, server::{command::ServerArgs, landlock::landlock_restrict_server}, @@ -37,7 +37,15 @@ mod core; /// You are only allowed to manage databases and users that are prefixed with /// either your username, or a group that you are a member of. #[derive(Parser, Debug)] -#[command(bin_name = "muscl", version, about, disable_help_subcommand = true)] +#[command( + bin_name = "muscl", + author = "Programvareverkstedet ", + version, + about, + disable_help_subcommand = true, + before_long_help = ASCII_BANNER, + after_long_help = KIND_REGARDS, +)] struct Args { #[command(subcommand)] command: Command, diff --git a/src/server/command.rs b/src/server/command.rs index bac0e4a..df4b277 100644 --- a/src/server/command.rs +++ b/src/server/command.rs @@ -6,7 +6,7 @@ use clap_verbosity_flag::Verbosity; use tracing_subscriber::prelude::*; use crate::{ - core::common::{ASCII_BANNER, DEFAULT_CONFIG_PATH}, + core::common::{ASCII_BANNER, DEFAULT_CONFIG_PATH, KIND_REGARDS}, server::supervisor::Supervisor, }; @@ -53,8 +53,7 @@ pub fn trace_server_prelude() { let message = [ ASCII_BANNER, "", - "Hacked together by yours truly, Programvareverkstedet ", - "If you experience any bugs or turbulence, please give us a heads up :)", + KIND_REGARDS, "", ] .join("\n");