From 02279a9225f6acc5e689d710ca3c19ad5dc957c2 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Wed, 29 Apr 2026 06:12:14 +0900 Subject: [PATCH] finger: add (but don't implement) `--raw` flag --- src/bin/finger.rs | 8 ++++++++ src/server/varlink_api.rs | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/src/bin/finger.rs b/src/bin/finger.rs index bd58d89..b62ae22 100644 --- a/src/bin/finger.rs +++ b/src/bin/finger.rs @@ -117,6 +117,13 @@ pub struct Args { #[arg(long, short)] json: bool, + /// When fingering remote users, don't try to parse the content before displaying it, + /// but instead just print the bytes as they are received from the remote. + /// + /// Note that this option makes it impossible to represent remote users as JSON. + #[arg(long, short, conflicts_with = "json")] + raw: bool, + /// Generate shell completion scripts for the specified shell /// and print them to stdout. #[arg(long, value_enum, hide = true)] @@ -182,6 +189,7 @@ async fn main() -> anyhow::Result<()> { request_info, request_networking, args.no_acct, + args.raw, ) .await .context("Failed to send finger request")? diff --git a/src/server/varlink_api.rs b/src/server/varlink_api.rs index 586d2a0..088bd2a 100644 --- a/src/server/varlink_api.rs +++ b/src/server/varlink_api.rs @@ -69,6 +69,7 @@ pub trait VarlinkFingerClientProxy { request_info: FingerRequestInfo, request_networking: FingerRequestNetworking, disable_user_account_db: bool, + raw_remote_output: bool, ) -> zlink::Result>; } @@ -82,6 +83,7 @@ pub enum VarlinkFingerClientRequest { request_info: FingerRequestInfo, request_networking: FingerRequestNetworking, disable_user_account_db: bool, + raw_remote_output: bool, }, } @@ -170,6 +172,7 @@ impl VarlinkRoowhoo2ClientServer { request_info: FingerRequestInfo, _request_networking: FingerRequestNetworking, _disable_user_account_db: bool, + _raw_remote_output: bool, ) -> VarlinkFingerResponse { tracing::debug!( user_queries = ?user_queries, @@ -284,6 +287,7 @@ impl zlink::Service for VarlinkRoowhoo2ClientServer { request_info, request_networking, disable_user_account_db, + raw_remote_output, }) => { let result = match timeout( Duration::from_secs(2), @@ -293,6 +297,7 @@ impl zlink::Service for VarlinkRoowhoo2ClientServer { request_info.clone(), request_networking.clone(), *disable_user_account_db, + *raw_remote_output, ), ) .await