finger: add (but don't implement) --raw flag
Build and test / check (push) Successful in 1m3s
Build and test / build (push) Successful in 1m32s
Build and test / test (push) Successful in 2m3s
Build and test / docs (push) Successful in 3m28s

This commit is contained in:
2026-04-29 06:12:14 +09:00
parent ff38ea3a35
commit 02279a9225
2 changed files with 13 additions and 0 deletions
+8
View File
@@ -117,6 +117,13 @@ pub struct Args {
#[arg(long, short)] #[arg(long, short)]
json: bool, 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 /// Generate shell completion scripts for the specified shell
/// and print them to stdout. /// and print them to stdout.
#[arg(long, value_enum, hide = true)] #[arg(long, value_enum, hide = true)]
@@ -182,6 +189,7 @@ async fn main() -> anyhow::Result<()> {
request_info, request_info,
request_networking, request_networking,
args.no_acct, args.no_acct,
args.raw,
) )
.await .await
.context("Failed to send finger request")? .context("Failed to send finger request")?
+5
View File
@@ -69,6 +69,7 @@ pub trait VarlinkFingerClientProxy {
request_info: FingerRequestInfo, request_info: FingerRequestInfo,
request_networking: FingerRequestNetworking, request_networking: FingerRequestNetworking,
disable_user_account_db: bool, disable_user_account_db: bool,
raw_remote_output: bool,
) -> zlink::Result<Result<VarlinkFingerResponse, VarlinkFingerClientError>>; ) -> zlink::Result<Result<VarlinkFingerResponse, VarlinkFingerClientError>>;
} }
@@ -82,6 +83,7 @@ pub enum VarlinkFingerClientRequest {
request_info: FingerRequestInfo, request_info: FingerRequestInfo,
request_networking: FingerRequestNetworking, request_networking: FingerRequestNetworking,
disable_user_account_db: bool, disable_user_account_db: bool,
raw_remote_output: bool,
}, },
} }
@@ -170,6 +172,7 @@ impl VarlinkRoowhoo2ClientServer {
request_info: FingerRequestInfo, request_info: FingerRequestInfo,
_request_networking: FingerRequestNetworking, _request_networking: FingerRequestNetworking,
_disable_user_account_db: bool, _disable_user_account_db: bool,
_raw_remote_output: bool,
) -> VarlinkFingerResponse { ) -> VarlinkFingerResponse {
tracing::debug!( tracing::debug!(
user_queries = ?user_queries, user_queries = ?user_queries,
@@ -284,6 +287,7 @@ impl zlink::Service<zlink::unix::Stream> for VarlinkRoowhoo2ClientServer {
request_info, request_info,
request_networking, request_networking,
disable_user_account_db, disable_user_account_db,
raw_remote_output,
}) => { }) => {
let result = match timeout( let result = match timeout(
Duration::from_secs(2), Duration::from_secs(2),
@@ -293,6 +297,7 @@ impl zlink::Service<zlink::unix::Stream> for VarlinkRoowhoo2ClientServer {
request_info.clone(), request_info.clone(),
request_networking.clone(), request_networking.clone(),
*disable_user_account_db, *disable_user_account_db,
*raw_remote_output,
), ),
) )
.await .await