Skip to content

Commit

Permalink
fix(client/v2): correctly check subcommand short descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
johnletey committed May 9, 2024
1 parent c4308d2 commit 25f012c
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 @@ -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)
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 25f012c

Please sign in to comment.