feat: v1.10.5, improve list json outputs
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -487,7 +487,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "card-cli"
|
||||
version = "1.10.4"
|
||||
version = "1.10.5"
|
||||
dependencies = [
|
||||
"authenticator 0.3.1",
|
||||
"base64 0.21.7",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "card-cli"
|
||||
version = "1.10.4"
|
||||
version = "1.10.5"
|
||||
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
|
||||
@@ -29,6 +29,15 @@ impl Command for CommandImpl {
|
||||
if let Ok(pin_retries) = yk.get_pin_retries() {
|
||||
json.insert("pin_retries", pin_retries.to_string());
|
||||
}
|
||||
if let Ok(chuid) = yk.chuid() {
|
||||
json.insert("chuid", chuid.to_string());
|
||||
}
|
||||
if let Ok(ccuid) = yk.cccid() {
|
||||
json.insert("ccuid", ccuid.to_string());
|
||||
}
|
||||
if let Ok(piv_keys) = yk.piv_keys() {
|
||||
json.insert("keys", piv_keys.iter().map(|k| format!("{}", k.slot())).collect::<Vec<_>>().join(", "));
|
||||
}
|
||||
|
||||
println!("{}", serde_json::to_string_pretty(&json).expect("Convert to JSON failed!"));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user