From 32625d41414414295a3847b6124939034971b692 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Wed, 13 May 2026 00:28:31 +0900 Subject: [PATCH] finger: format results --- src/bin/finger.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/bin/finger.rs b/src/bin/finger.rs index b62ae22..6579bd7 100644 --- a/src/bin/finger.rs +++ b/src/bin/finger.rs @@ -1,9 +1,12 @@ use anyhow::Context; use clap::{CommandFactory, Parser, builder::ArgPredicate}; use clap_complete::{Shell, generate}; -use roowho2_lib::server::{ - fingerd::{FingerRequestInfo, FingerRequestNetworking}, - varlink_api::VarlinkFingerClientProxy, +use roowho2_lib::{ + proto::finger_protocol::FingerResponseUserEntry, + server::{ + fingerd::{FingerRequestInfo, FingerRequestNetworking}, + varlink_api::VarlinkFingerClientProxy, + }, }; /// User information lookup program @@ -199,7 +202,14 @@ async fn main() -> anyhow::Result<()> { println!("{}", serde_json::to_string_pretty(&reply).unwrap()); } else { for user in reply { - println!("{:#?}", user); + match user { + FingerResponseUserEntry::Structured(structured) => { + println!("{}", structured.classic_format()); + } + FingerResponseUserEntry::Raw(raw) => { + println!("{}", raw); + } + } } }