From 431412bef2b9eb25ebfc496e7c5bfd75ea228bbc Mon Sep 17 00:00:00 2001 From: John Letey Date: Fri, 10 May 2024 08:39:03 +0200 Subject: [PATCH] fix(client/v2): correctly check subcommand short descriptions (#20330) --- client/v2/autocli/msg.go | 4 ++-- client/v2/autocli/query.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/v2/autocli/msg.go b/client/v2/autocli/msg.go index 0b3143620f..797c4c4173 100644 --- a/client/v2/autocli/msg.go +++ b/client/v2/autocli/msg.go @@ -47,8 +47,8 @@ func (b *Builder) AddMsgServiceCommands(cmd *cobra.Command, cmdDescriptor *autoc for cmdName, subCmdDescriptor := range cmdDescriptor.SubCommands { subCmd := findSubCommand(cmd, cmdName) if subCmd == nil { - short := cmdDescriptor.Short - if cmdDescriptor.Short == "" { + short := subCmdDescriptor.Short + if short == "" { short = fmt.Sprintf("Tx commands for the %s service", subCmdDescriptor.Service) } subCmd = topLevelCmd(cmd.Context(), cmdName, short) diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index d9f01cd70d..ace56f459c 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -41,7 +41,7 @@ func (b *Builder) AddQueryServiceCommands(cmd *cobra.Command, cmdDescriptor *aut for cmdName, subCmdDesc := range cmdDescriptor.SubCommands { subCmd := findSubCommand(cmd, cmdName) if subCmd == nil { - short := cmdDescriptor.Short + short := subCmdDesc.Short if short == "" { short = fmt.Sprintf("Querying commands for the %s service", subCmdDesc.Service) }