Do not return a '-1' exit if no keys found and json/yaml output

This commit is contained in:
Jeroen van Erp 2022-03-17 10:06:22 +01:00
parent b2bb322a57
commit 3955883f6b
No known key found for this signature in database
GPG Key ID: EBE906E1F4ACA3B7
1 changed files with 3 additions and 3 deletions

View File

@ -105,12 +105,12 @@ func RunGetSSHPublicKeys(ctx context.Context, f *util.Factory, out io.Writer, op
items = append(items, item)
}
if len(items) == 0 {
return fmt.Errorf("no SSH public key found")
}
switch options.Output {
case OutputTable:
if len(items) == 0 {
return fmt.Errorf("no SSH public key found")
}
t := &tables.Table{}
t.AddColumn("ID", func(i *SSHKeyItem) string {
return i.ID