diff --git a/client/v2/CHANGELOG.md b/client/v2/CHANGELOG.md index 36a91eff82e2..426244bc14ce 100644 --- a/client/v2/CHANGELOG.md +++ b/client/v2/CHANGELOG.md @@ -36,6 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Bug Fixes + +* [#21809](https://github.com/cosmos/cosmos-sdk/pull/21809) Correctly handle enhanced sub commands. + ## [v2.0.0-beta.5] - 2024-09-18 ### Improvements diff --git a/client/v2/autocli/msg.go b/client/v2/autocli/msg.go index 5459c245a228..322fa6b26228 100644 --- a/client/v2/autocli/msg.go +++ b/client/v2/autocli/msg.go @@ -49,7 +49,9 @@ func (b *Builder) AddMsgServiceCommands(cmd *cobra.Command, cmdDescriptor *autoc return err } - cmd.AddCommand(subCmd) + if !subCmdDescriptor.EnhanceCustomCommand { + cmd.AddCommand(subCmd) + } } if cmdDescriptor.Service == "" { diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index 7e0f4cbc3185..dcb41bbfa25a 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -52,7 +52,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