feat(cli): enhance --version output with component versions

This commit is contained in:
Nils Andreas Svee committed 2026-10-21 14:42:49 +07:00
1 parent 7d640793b6
commit 5481009fe3
9 files changed
+61 -14

No files matched your search

+5 -9
View File
@@ -89,11 +89,10 @@ fn with_shutdown_flag(
#[cfg(feature = "client")]
fn run_client_applet(argv: Vec<OsString>) -> Result<(), Box<dyn std::error::Error>> {
use clap::Parser;
let shutdown = crate::signal::install_async_signal_handler()
.map_err(|err| format!("failed to install signal handler: {err}"))?;
let args = crate::cmd::client::ClientArgs::parse_from(argv);
let args =
crate::version::parse::<crate::cmd::client::ClientArgs>(argv, crate::version::client);
tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()?
@@ -107,10 +106,9 @@ fn run_client_applet(_argv: Vec<OsString>) -> Result<(), Box<dyn std::error::Err
#[cfg(feature = "server")]
fn run_server_applet(argv: Vec<OsString>) -> Result<(), Box<dyn std::error::Error>> {
use clap::Parser;
with_shutdown_flag(|shutdown_requested| {
let args = crate::cmd::server::ServerArgs::parse_from(argv);
let args =
crate::version::parse::<crate::cmd::server::ServerArgs>(argv, crate::version::server);
crate::cmd::server::run_server(args, shutdown_requested)
})
}
@@ -122,11 +120,9 @@ fn run_server_applet(_argv: Vec<OsString>) -> Result<(), Box<dyn std::error::Err
#[cfg(feature = "tui")]
fn run_tui_applet(argv: Vec<OsString>) -> Result<(), Box<dyn std::error::Error>> {
use clap::Parser;
let shutdown = crate::signal::install_async_signal_handler()
.map_err(|err| format!("failed to install signal handler: {err}"))?;
let args = crate::cmd::tui::TuiArgs::parse_from(argv);
let args = crate::version::parse::<crate::cmd::tui::TuiArgs>(argv, crate::version::client);
tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()?