From 1aca5d47e314280a2b356ffd97951cfc94d2aa01 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 6 Jan 2026 11:48:26 +0900 Subject: [PATCH] Add `--version` flags and more to all binaries --- src/bin/finger.rs | 5 +++++ src/bin/roowhod.rs | 5 +++++ src/bin/rup.rs | 5 +++++ src/bin/ruptime.rs | 7 ++++++- src/bin/rusers.rs | 5 +++++ src/bin/rwall.rs | 5 +++++ src/bin/rwho.rs | 5 +++++ 7 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/bin/finger.rs b/src/bin/finger.rs index badad26..0e2e95e 100644 --- a/src/bin/finger.rs +++ b/src/bin/finger.rs @@ -19,6 +19,11 @@ use clap::Parser; /// If standard output is a socket, finger will emit a carriage return (^M) before every linefeed (^J). /// This is for processing remote finger requests when invoked by the daemon. #[derive(Debug, Parser)] +#[command( + author = "Programvareverkstedet ", + about, + version, +)] pub struct Args { /// Forces finger to use IPv4 addresses only. #[arg(long, short = '4', conflicts_with = "ipv6")] diff --git a/src/bin/roowhod.rs b/src/bin/roowhod.rs index 2183641..c3e7da4 100644 --- a/src/bin/roowhod.rs +++ b/src/bin/roowhod.rs @@ -18,6 +18,11 @@ use tokio::{net::UdpSocket, sync::RwLock}; use tracing_subscriber::{EnvFilter, fmt, layer::SubscriberExt, util::SubscriberInitExt}; #[derive(Parser)] +#[command( + author = "Programvareverkstedet ", + about, + version +)] struct Args { /// Path to configuration file #[arg( diff --git a/src/bin/rup.rs b/src/bin/rup.rs index bc7fe1b..bab550d 100644 --- a/src/bin/rup.rs +++ b/src/bin/rup.rs @@ -6,6 +6,11 @@ use clap::Parser; /// The output shows the current time of day, how long the system has been up, and the load averages. /// The load average numbers give the number of jobs in the run queue averaged over 1, 5 and 15 minutes. #[derive(Debug, Parser)] +#[command( + author = "Programvareverkstedet ", + about, + version, +)] pub struct Args { /// The hosts to query. hosts: Vec, diff --git a/src/bin/ruptime.rs b/src/bin/ruptime.rs index 8895564..f6d5f3c 100644 --- a/src/bin/ruptime.rs +++ b/src/bin/ruptime.rs @@ -11,6 +11,11 @@ use roowho2_lib::{proto::WhodStatusUpdate, server::rwhod::RwhodClientProxy}; /// /// Machines for which no status report has been received for 11 minutes are shown as being down. #[derive(Debug, Parser)] +#[command( + author = "Programvareverkstedet ", + about, + version +)] pub struct Args { /// Users idle an hour or more are not counted unless the `-a` flag is given. #[arg(long, short)] @@ -120,7 +125,7 @@ fn old_format_machine_entry(all: bool, entry: &WhodStatusUpdate) -> String { let uptime_str = if days > 0 { format!("{:3}+{:02}:{:02}", days, hours, minutes) } else if uptime_minutes < 0 || days > 999 { - format!(" ??:??") + " ??:??".to_string() } else { format!(" {:2}:{:02}", hours, minutes) }; diff --git a/src/bin/rusers.rs b/src/bin/rusers.rs index 6276d28..44f777d 100644 --- a/src/bin/rusers.rs +++ b/src/bin/rusers.rs @@ -8,6 +8,11 @@ use clap::Parser; /// the host-name with the names of the users currently logged on is printed on each line. /// The `rusers` command will wait for one minute to catch late responders. #[derive(Debug, Parser)] +#[command( + author = "Programvareverkstedet ", + about, + version, +)] pub struct Args { /// Print all machines responding even if no one is currently logged in #[arg(long, short)] diff --git a/src/bin/rwall.rs b/src/bin/rwall.rs index ed875fd..9161065 100644 --- a/src/bin/rwall.rs +++ b/src/bin/rwall.rs @@ -5,6 +5,11 @@ use clap::Parser; /// The `rwall` command sends a message to the users logged into the specified host. /// The message to be sent can be typed in and terminated with EOF or it can be in a file #[derive(Debug, Parser)] +#[command( + author = "Programvareverkstedet ", + about, + version, +)] pub struct Args { /// The host to send the message to host: String, diff --git a/src/bin/rwho.rs b/src/bin/rwho.rs index 4e4f3aa..6fa1e9a 100644 --- a/src/bin/rwho.rs +++ b/src/bin/rwho.rs @@ -12,6 +12,11 @@ use roowho2_lib::{proto::WhodUserEntry, server::rwhod::RwhodClientProxy}; /// If a user hasn't typed to the system for an hour or more, /// then the user will be omitted from the output of `rwho` unless the `-a` flag is given. #[derive(Debug, Parser)] +#[command( + author = "Programvareverkstedet ", + about, + version +)] pub struct Args { /// Print all machines responding even if no one is currently logged in #[arg(long, short)]