Make --list{-all} and --identity behave the same way

- Both commands print all slots from all connected YubiKeys by default.
- If --serial is specified (without --slot) then print all slots in that
  YubiKey.
- If --slot is specified then then instead print a single slot (requiring
  --serial if necessary to select a single YubiKey).

Closes str4d/age-plugin-yubikey#26.
This commit is contained in:
Jack Grigg
2021-04-29 00:04:37 +12:00
parent 2a013fc018
commit 458a09125f
3 changed files with 73 additions and 46 deletions
+3 -3
View File
@@ -49,18 +49,18 @@ fn main() {
Flag::new()
.short("-i")
.long("--identity")
.help("Print the identity stored in a YubiKey slot."),
.help("Print identities stored in connected YubiKeys."),
)
.flag(
Flag::new()
.short("-l")
.long("--list")
.help("List all age identities in connected YubiKeys."),
.help("List recipients for age identities in connected YubiKeys."),
)
.flag(
Flag::new()
.long("--list-all")
.help("List all YubiKey keys that are compatible with age."),
.help("List recipients for all YubiKey keys that are compatible with age."),
)
.flag(
Flag::new()