From 174ca005f17c9db7001640de29ea0088fb9781ea Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:24:00 +0200 Subject: [PATCH] fix(client/v2): correctly handle enhanced sub commands (backport #21809) (#21929) Co-authored-by: John Letey --- 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 b19aabc95b..9eb4f0444b 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 166be5efeb..d308bcd763 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