From 53f58426b23e6e5de9127b7fa0bd1bce2d9b1225 Mon Sep 17 00:00:00 2001 From: John Letey Date: Wed, 18 Sep 2024 12:55:12 -0400 Subject: [PATCH 1/2] fix: correctly handle enhanced sub commands --- 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..e24b86645e11 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 !subCmdDesc.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 From 0969e1ec6f75e32f929c68022817e1644c55b88e Mon Sep 17 00:00:00 2001 From: John Letey Date: Wed, 18 Sep 2024 13:01:30 -0400 Subject: [PATCH 2/2] chore: small nit --- client/v2/autocli/msg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/v2/autocli/msg.go b/client/v2/autocli/msg.go index e24b86645e11..9eb4f0444bba 100644 --- a/client/v2/autocli/msg.go +++ b/client/v2/autocli/msg.go @@ -58,7 +58,7 @@ func (b *Builder) AddMsgServiceCommands(cmd *cobra.Command, cmdDescriptor *autoc return err } - if !subCmdDesc.EnhanceCustomCommand { + if !subCmdDescriptor.EnhanceCustomCommand { cmd.AddCommand(subCmd) } }