From d36fed45d16c93bc9c2ebab8d722fa7a770904cf Mon Sep 17 00:00:00 2001 From: John Letey Date: Thu, 26 Sep 2024 15:04:20 +0200 Subject: [PATCH] fix(client/v2): correctly handle enhanced sub commands (#21809) (cherry picked from commit 13f1d6cf665f26cfe31bc747b5d79111ab8a2c86) --- client/v2/autocli/msg.go | 4 +++- client/v2/autocli/query.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/v2/autocli/msg.go b/client/v2/autocli/msg.go index b19aabc95ba0..9eb4f0444bba 100644 --- a/client/v2/autocli/msg.go +++ b/client/v2/autocli/msg.go @@ -58,7 +58,9 @@ func (b *Builder) AddMsgServiceCommands(cmd *cobra.Command, cmdDescriptor *autoc return err } - cmd.AddCommand(subCmd) + if !subCmdDescriptor.EnhanceCustomCommand { + cmd.AddCommand(subCmd) + } } if cmdDescriptor.Service == "" { diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index 166be5efebdc..d308bcd7633a 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -53,7 +53,9 @@ func (b *Builder) AddQueryServiceCommands(cmd *cobra.Command, cmdDescriptor *aut return err } - cmd.AddCommand(subCmd) + if !subCmdDesc.EnhanceCustomCommand { + cmd.AddCommand(subCmd) + } } // skip empty command descriptors