Show error if secret name is missing (#4014)

This commit is contained in:
qwerty287 2024-08-08 00:26:50 +02:00 committed by GitHub
parent c0b1d6aaa4
commit 107564f54c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,6 +16,7 @@ package secret
import (
"context"
"fmt"
"html/template"
"os"
@ -51,6 +52,11 @@ func secretInfo(ctx context.Context, c *cli.Command) error {
secretName = c.String("name")
format = c.String("format") + "\n"
)
if secretName == "" {
return fmt.Errorf("secret name is missing")
}
client, err := internal.NewClient(ctx, c)
if err != nil {
return err