Skip to content

Commit

Permalink
display key type for listing command
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyYe committed May 5, 2021
1 parent 32a03a9 commit 73d80bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/skm/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,17 @@ func list(c *cli.Context) error {
for _, k := range keys {
key := keyMap[k]
keyDesc := ""
keyType := ""

keyStr := strings.SplitAfterN(getKeyPayload(key.PublicKey), " ", 3)
if len(keyStr) >= 3 {
keyDesc = strings.TrimSpace(keyStr[2])
keyType = strings.TrimSpace(keyStr[0])
}
if key.IsDefault {
color.Green("->\t%s\t[%s]", k, keyDesc)
color.Green("->\t%s\t[%s]\t[%s]", k, keyType, keyDesc)
} else {
color.Blue("\t%s\t[%s]", k, keyDesc)
color.Blue("\t%s\t[%s]\t[%s]", k, keyType, keyDesc)
}
}
return nil
Expand Down

0 comments on commit 73d80bd

Please sign in to comment.