feat: table style

This commit is contained in:
2023-08-26 14:21:19 +08:00
parent 8e2dce9b39
commit 746fdbb53d

View File

@@ -3,6 +3,7 @@ use rust_util::util_clap::{Command, CommandError};
use rust_util::XResult; use rust_util::XResult;
use spki::der::Encode; use spki::der::Encode;
use tabled::{Table, Tabled}; use tabled::{Table, Tabled};
use tabled::settings::Style;
use x509_parser::parse_x509_certificate; use x509_parser::parse_x509_certificate;
use yubikey::{Certificate, YubiKey}; use yubikey::{Certificate, YubiKey};
use yubikey::piv::SlotId; use yubikey::piv::SlotId;
@@ -62,7 +63,9 @@ impl Command for CommandImpl {
print_summary_info(&mut yk, slot, &mut piv_slots, show_all, show_table).ok(); print_summary_info(&mut yk, slot, &mut piv_slots, show_all, show_table).ok();
} }
if show_table { if show_table {
println!("{}", Table::new(piv_slots).to_string()); let mut table = Table::new(piv_slots);
table.with(Style::rounded());
println!("{}", table.to_string());
} }
Ok(None) Ok(None)
} }