bin/*: extended --version output
Build and test / check (push) Successful in 2m51s
Build and test / build (push) Successful in 2m53s
Build and test / test (push) Successful in 2m55s
Build and test / docs (push) Successful in 7m0s

This commit is contained in:
2026-07-30 20:55:50 +09:00
parent b23beecd21
commit 58f711cbef
14 changed files with 578 additions and 21 deletions
+6 -1
View File
@@ -9,6 +9,7 @@ use roowho2_lib::{
DEFAULT_CLIENT_SERVER_SOCKET_PATH, VarlinkFingerClientError, VarlinkFingerClientProxy,
},
},
version,
};
/// User information lookup program
@@ -30,7 +31,11 @@ use roowho2_lib::{
/// 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 <projects@pvv.ntnu.no>", version)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
version,
long_version = version::LONG_VERSION
)]
pub struct Args {
/// Forces finger to use IPv4 addresses only.
#[arg(long, short = '4', conflicts_with = "ipv6")]
+14 -9
View File
@@ -13,20 +13,25 @@ use tokio_util::sync::CancellationToken;
use tracing::level_filters::LevelFilter;
use tracing_subscriber::layer::SubscriberExt;
use roowho2_lib::server::{
config::{DEFAULT_CONFIG_PATH, LogLevel},
ignore_list::IgnoreList,
rwhod::{
RwhodStatusRegistry, RwhodStatusStore, rwhod_packet_receiver_task, rwhod_packet_sender_task,
use roowho2_lib::{
server::{
config::{DEFAULT_CONFIG_PATH, LogLevel},
ignore_list::IgnoreList,
rwhod::{
RwhodStatusRegistry, RwhodStatusStore, rwhod_packet_receiver_task,
rwhod_packet_sender_task,
},
varlink_api::varlink_client_server_task,
},
varlink_api::varlink_client_server_task,
version,
};
#[derive(Parser)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
about,
version
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
about,
version,
long_version = version::LONG_VERSION
)]
struct Args {
/// Path to configuration file
+5 -1
View File
@@ -6,7 +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 <projects@pvv.ntnu.no>", version)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
version,
long_version = crate::version::LONG_VERSION
)]
pub struct Args {
/// The hosts to query.
hosts: Vec<String>,
+6 -1
View File
@@ -8,6 +8,7 @@ use roowho2_lib::{
server::varlink_api::{
DEFAULT_CLIENT_SERVER_SOCKET_PATH, VarlinkRwhodClientError, VarlinkRwhodClientProxy,
},
version,
};
/// Show host status of local machines.
@@ -18,7 +19,11 @@ use roowho2_lib::{
/// Machines for which no status report has been received for a while (11 minutes by default,
/// see `--uptime-timeout`) are shown as being down.
#[derive(Debug, Parser)]
#[command(author = "Programvareverkstedet <projects@pvv.ntnu.no>", version)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
version,
long_version = version::LONG_VERSION
)]
pub struct Args {
/// Users idle an hour or more are not counted unless the `-a` flag is given.
#[arg(long, short, conflicts_with = "idle_timeout")]
+6 -1
View File
@@ -1,4 +1,5 @@
use clap::Parser;
use roowho2_lib::version;
/// Check who is logged in to machines on local network.
///
@@ -8,7 +9,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 <projects@pvv.ntnu.no>", version)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
version,
long_version = version::LONG_VERSION
)]
pub struct Args {
/// Print all machines responding even if no one is currently logged in
#[arg(long, short)]
+6 -1
View File
@@ -1,11 +1,16 @@
use clap::Parser;
use roowho2_lib::version;
/// Send a message to users logged on a 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
#[derive(Debug, Parser)]
#[command(author = "Programvareverkstedet <projects@pvv.ntnu.no>", version)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
version,
long_version = version::LONG_VERSION
)]
pub struct Args {
/// The host to send the message to
host: String,
+6 -1
View File
@@ -8,6 +8,7 @@ use roowho2_lib::{
server::varlink_api::{
DEFAULT_CLIENT_SERVER_SOCKET_PATH, VarlinkRwhodClientError, VarlinkRwhodClientProxy,
},
version,
};
/// Check who is logged in on local machines.
@@ -20,7 +21,11 @@ use roowho2_lib::{
/// 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 <projects@pvv.ntnu.no>", version)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
version,
long_version = version::LONG_VERSION
)]
pub struct Args {
/// Print all machines responding even if no one is currently logged in
#[arg(long, short, conflicts_with = "idle_timeout")]
+10 -3
View File
@@ -7,13 +7,20 @@ use anyhow::Context;
use clap::{CommandFactory, Parser};
use clap_complete::{Shell, generate};
use nix::unistd;
use roowho2_lib::server::varlink_api::{
DEFAULT_CLIENT_SERVER_SOCKET_PATH, VarlinkWalldClientProxy, VarlinkWalldClientResponse,
use roowho2_lib::{
server::varlink_api::{
DEFAULT_CLIENT_SERVER_SOCKET_PATH, VarlinkWalldClientProxy, VarlinkWalldClientResponse,
},
version,
};
/// Write a message to all users
#[derive(Debug, Parser)]
#[command(author = "Programvareverkstedet <projects@pvv.ntnu.no>", version)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
version,
long_version = version::LONG_VERSION
)]
pub struct Args {
/// Only send message to group
#[arg(long, short, value_name = "GROUP")]
+10 -3
View File
@@ -8,13 +8,20 @@ use clap::{CommandFactory, Parser};
use clap_complete::{Shell, generate};
use nix::unistd;
use roowho2_lib::server::varlink_api::{
DEFAULT_CLIENT_SERVER_SOCKET_PATH, VarlinkWalldClientProxy, VarlinkWalldClientResponse,
use roowho2_lib::{
server::varlink_api::{
DEFAULT_CLIENT_SERVER_SOCKET_PATH, VarlinkWalldClientProxy, VarlinkWalldClientResponse,
},
version,
};
/// Send a message to another user
#[derive(Debug, Parser)]
#[command(author = "Programvareverkstedet <projects@pvv.ntnu.no>", version)]
#[command(
author = "Programvareverkstedet <projects@pvv.ntnu.no>",
version,
long_version = version::LONG_VERSION
)]
pub struct Args {
/// User to send the message to
#[arg(value_name = "USER", required_unless_present = "completions")]
+1
View File
@@ -5,3 +5,4 @@
pub mod proto;
pub mod server;
pub mod util;
pub mod version;
+31
View File
@@ -0,0 +1,31 @@
use clap::crate_version;
const fn long_version() -> &'static str {
// macro_rules! feature {
// ($title:expr, $flag:expr) => {
// if cfg!(feature = $flag) {
// concat!($title, ": enabled")
// } else {
// concat!($title, ": disabled")
// }
// };
// }
const_format::concatcp!(
crate_version!(),
"\n",
"build profile: ",
env!("BUILD_PROFILE"),
"\n",
"commit: ",
env!("GIT_COMMIT"),
"\n\n",
// "[features]\n",
// "\n",
// "\n",
"[dependencies]\n",
const_format::str_replace!(env!("DEPENDENCY_LIST"), ";", "\n")
)
}
pub const LONG_VERSION: &str = long_version();