From 001bbd4412d4ac01927baa5cd41816237f0c2a16 Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Mon, 31 Oct 2022 13:44:27 +0100 Subject: [PATCH] opgpcard: tweak 'info' text output; add FIXME to re-work the form of algorithm information output --- tools/src/bin/opgpcard/commands/info.rs | 7 ++++++- tools/src/bin/opgpcard/output/status.rs | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/src/bin/opgpcard/commands/info.rs b/tools/src/bin/opgpcard/commands/info.rs index 278da5c..732a747 100644 --- a/tools/src/bin/opgpcard/commands/info.rs +++ b/tools/src/bin/opgpcard/commands/info.rs @@ -72,9 +72,14 @@ pub fn print_info( } // Algorithm information (list of supported algorithms) + // + // FIXME: this should be output in a more structured shape + // Algorithms should be grouped by key slot, and the format of the algorithm name should + // probably have a human readable, and an alternate machine readable format. + // Both formats should be output for machine readable formats. if let Ok(Some(ai)) = card.algorithm_information() { for line in ai.to_string().lines() { - let line = line.strip_prefix("- ").unwrap_or(line); + let line = line.strip_prefix("- ").unwrap_or_else(|| line.trim()); output.algorithm(line.to_string()); } } diff --git a/tools/src/bin/opgpcard/output/status.rs b/tools/src/bin/opgpcard/output/status.rs index f7d3cdf..9b1e726 100644 --- a/tools/src/bin/opgpcard/output/status.rs +++ b/tools/src/bin/opgpcard/output/status.rs @@ -142,9 +142,9 @@ impl Status { } if self.verbose { if self.user_pin_valid_for_only_one_signature { - s.push_str(" User PIN presentation valid for one signature\n"); + s.push_str(" User PIN presentation is valid for only one signature\n"); } else { - s.push_str(" User PIN presentation valid for unlimited signatures\n"); + s.push_str(" User PIN presentation is valid for unlimited signatures\n"); } } s.push_str(&format!(" Signatures made: {}\n", self.signature_count));