@@ -14,8 +14,7 @@ import (
14
14
)
15
15
16
16
type DeleteApiKeyOptions struct {
17
- apiKeyId string
18
- skipConfirmation bool
17
+ apiKeyId string
19
18
}
20
19
21
20
func NewDeleteKeyCmd () * cobra.Command {
@@ -27,7 +26,8 @@ func NewDeleteKeyCmd() *cobra.Command {
27
26
GroupID : help .GROUP_API_KEYS .ID ,
28
27
Example : heredoc .Doc (`
29
28
$ pc target -o "my-org" -p "my-project"
30
- $ pc api-key delete -i "api-key-id"
29
+ $ pc api-key delete -i "api-key-id"
30
+ $ pc api-key delete -i "api-key-id" -y
31
31
` ),
32
32
Run : func (cmd * cobra.Command , args []string ) {
33
33
ac := sdk .NewPineconeAdminClient ()
@@ -41,7 +41,9 @@ func NewDeleteKeyCmd() *cobra.Command {
41
41
exit .Error (err )
42
42
}
43
43
44
- if ! options .skipConfirmation {
44
+ // Check if -y flag is set
45
+ assumeYes , _ := cmd .Flags ().GetBool ("assume-yes" )
46
+ if ! assumeYes {
45
47
confirmDeleteApiKey (keyToDelete .Name )
46
48
}
47
49
@@ -57,7 +59,6 @@ func NewDeleteKeyCmd() *cobra.Command {
57
59
cmd .Flags ().StringVarP (& options .apiKeyId , "id" , "i" , "" , "The ID of the API key to delete" )
58
60
_ = cmd .MarkFlagRequired ("id" )
59
61
60
- cmd .Flags ().BoolVar (& options .skipConfirmation , "skip-confirmation" , false , "Skip deletion confirmation prompt" )
61
62
return cmd
62
63
}
63
64
0 commit comments