Add --version flags and more to all binaries
Build and test / check (push) Successful in 1m8s
Build and test / test (push) Successful in 1m46s
Build and test / build (push) Successful in 2m12s
Build and test / docs (push) Successful in 3m18s

This commit is contained in:
2026-01-06 11:48:26 +09:00
parent f0e22fc85c
commit 1aca5d47e3
7 changed files with 36 additions and 1 deletions
+5
View File
@@ -19,6 +19,11 @@ use clap::Parser;
/// If standard output is a socket, finger will emit a carriage return (^M) before every linefeed (^J). /// 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. /// This is for processing remote finger requests when invoked by the daemon.
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
about,
version,
)]
pub struct Args { pub struct Args {
/// Forces finger to use IPv4 addresses only. /// Forces finger to use IPv4 addresses only.
#[arg(long, short = '4', conflicts_with = "ipv6")] #[arg(long, short = '4', conflicts_with = "ipv6")]
+5
View File
@@ -18,6 +18,11 @@ use tokio::{net::UdpSocket, sync::RwLock};
use tracing_subscriber::{EnvFilter, fmt, layer::SubscriberExt, util::SubscriberInitExt}; use tracing_subscriber::{EnvFilter, fmt, layer::SubscriberExt, util::SubscriberInitExt};
#[derive(Parser)] #[derive(Parser)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
about,
version
)]
struct Args { struct Args {
/// Path to configuration file /// Path to configuration file
#[arg( #[arg(
+5
View File
@@ -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 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. /// The load average numbers give the number of jobs in the run queue averaged over 1, 5 and 15 minutes.
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
about,
version,
)]
pub struct Args { pub struct Args {
/// The hosts to query. /// The hosts to query.
hosts: Vec<String>, hosts: Vec<String>,
+6 -1
View File
@@ -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. /// Machines for which no status report has been received for 11 minutes are shown as being down.
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
about,
version
)]
pub struct Args { pub struct Args {
/// Users idle an hour or more are not counted unless the `-a` flag is given. /// Users idle an hour or more are not counted unless the `-a` flag is given.
#[arg(long, short)] #[arg(long, short)]
@@ -120,7 +125,7 @@ fn old_format_machine_entry(all: bool, entry: &WhodStatusUpdate) -> String {
let uptime_str = if days > 0 { let uptime_str = if days > 0 {
format!("{:3}+{:02}:{:02}", days, hours, minutes) format!("{:3}+{:02}:{:02}", days, hours, minutes)
} else if uptime_minutes < 0 || days > 999 { } else if uptime_minutes < 0 || days > 999 {
format!(" ??:??") " ??:??".to_string()
} else { } else {
format!(" {:2}:{:02}", hours, minutes) format!(" {:2}:{:02}", hours, minutes)
}; };
+5
View File
@@ -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 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. /// The `rusers` command will wait for one minute to catch late responders.
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
about,
version,
)]
pub struct Args { pub struct Args {
/// Print all machines responding even if no one is currently logged in /// Print all machines responding even if no one is currently logged in
#[arg(long, short)] #[arg(long, short)]
+5
View File
@@ -5,6 +5,11 @@ use clap::Parser;
/// The `rwall` command sends a message to the users logged into the specified host. /// 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 /// The message to be sent can be typed in and terminated with EOF or it can be in a file
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
about,
version,
)]
pub struct Args { pub struct Args {
/// The host to send the message to /// The host to send the message to
host: String, host: String,
+5
View File
@@ -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, /// 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. /// then the user will be omitted from the output of `rwho` unless the `-a` flag is given.
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
about,
version
)]
pub struct Args { pub struct Args {
/// Print all machines responding even if no one is currently logged in /// Print all machines responding even if no one is currently logged in
#[arg(long, short)] #[arg(long, short)]