@@ -14,8 +14,7 @@ import (
1414)
1515
1616type DeleteApiKeyOptions struct {
17- apiKeyId string
18- skipConfirmation bool
17+ apiKeyId string
1918}
2019
2120func NewDeleteKeyCmd () * cobra.Command {
@@ -27,7 +26,8 @@ func NewDeleteKeyCmd() *cobra.Command {
2726 GroupID : help .GROUP_API_KEYS .ID ,
2827 Example : heredoc .Doc (`
2928 $ 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
3131 ` ),
3232 Run : func (cmd * cobra.Command , args []string ) {
3333 ac := sdk .NewPineconeAdminClient ()
@@ -41,7 +41,9 @@ func NewDeleteKeyCmd() *cobra.Command {
4141 exit .Error (err )
4242 }
4343
44- if ! options .skipConfirmation {
44+ // Check if -y flag is set
45+ assumeYes , _ := cmd .Flags ().GetBool ("assume-yes" )
46+ if ! assumeYes {
4547 confirmDeleteApiKey (keyToDelete .Name )
4648 }
4749
@@ -57,7 +59,6 @@ func NewDeleteKeyCmd() *cobra.Command {
5759 cmd .Flags ().StringVarP (& options .apiKeyId , "id" , "i" , "" , "The ID of the API key to delete" )
5860 _ = cmd .MarkFlagRequired ("id" )
5961
60- cmd .Flags ().BoolVar (& options .skipConfirmation , "skip-confirmation" , false , "Skip deletion confirmation prompt" )
6162 return cmd
6263}
6364
0 commit comments