fix(client/v2): correctly check subcommand short descriptions (#20330)

This commit is contained in:
John Letey
2024-05-10 06:39:03 +00:00
committed by GitHub
parent c4308d2da0
commit 431412bef2
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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)
}