Skip to content

Commit

Permalink
fix(client/v2): correctly check subcommand short descriptions (#20330)
Browse files Browse the repository at this point in the history
(cherry picked from commit 431412b)
  • Loading branch information
johnletey authored and mergify[bot] committed May 10, 2024
1 parent 3904228 commit 73c36d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client/v2/autocli/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,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)
Expand Down
2 changes: 1 addition & 1 deletion client/v2/autocli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 73c36d1

Please sign in to comment.