package cmd import ( "fmt" "git.wntrmute.dev/kyle/arca/internal/unlock" ) // formatMethod returns a parenthesized string describing how a device // was unlocked, e.g. "(fido2, key slot 1)" or "(passphrase)". func formatMethod(r *unlock.Result) string { if r.Method == "" { return "" } if r.KeySlot != "" { return fmt.Sprintf("(%s, key slot %s)", r.Method, r.KeySlot) } return fmt.Sprintf("(%s)", r.Method) }