Skip to content

Commit

Permalink
chore: improve align cli help (backport #18179) (#18187)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Robert <[email protected]>
  • Loading branch information
mergify[bot] and julienrbrt authored Oct 20, 2023
1 parent 0c9930d commit c81038c
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 34 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ run:
skip-files:
- server/grpc/gogoreflection/fix_registration.go
- "fix_registration.go"
- "x/bank/migrations/v4/gen_state_test.go"
- ".*\\.pb\\.go$"
- ".*\\.pb\\.gw\\.go$"
- ".*\\.pulsar\\.go$"
Expand Down
5 changes: 2 additions & 3 deletions x/auth/vesting/autocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ timestamp.`,
RpcMethod: "CreatePermanentLockedAccount",
Use: "create-permanent-locked-account [to_address] [amount]",
Short: "Create a new permanently locked account funded with an allocation of tokens.",
Long: `Create a new account funded with an allocation of permanently locked tokens. These
tokens may be used for staking but are non-transferable. Staking rewards will acrue as liquid and transferable
tokens.`,
Long: `Create a new account funded with an allocation of permanently locked tokens.
These tokens may be used for staking but are non-transferable. Staking rewards will acrue as liquid and transferable tokens.`,
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "to_address"},
{ProtoField: "amount", Varargs: true},
Expand Down
11 changes: 5 additions & 6 deletions x/bank/autocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
Short: "Query for send enabled entries",
Long: strings.TrimSpace(`Query for send enabled entries that have been specifically set.
To look up one or more specific denoms, supply them as arguments to this command.
To look up all denoms, do not provide any arguments.
`,
To look up one or more specific denoms, supply them as arguments to this command.
To look up all denoms, do not provide any arguments.`,
),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "denoms"}},
},
Expand All @@ -96,9 +95,9 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
Use: "send [from_key_or_address] [to_address] [amount]",
Short: "Send funds from one account to another.",
Long: `Send funds from one account to another.
Note, the '--from' flag is ignored as it is implied from [from_key_or_address].
When using '--dry-run' a key name cannot be used, only a bech32 address.
Note: multiple coins can be send by space separated.`,
Note, the '--from' flag is ignored as it is implied from [from_key_or_address].
When using '--dry-run' a key name cannot be used, only a bech32 address.
Note: multiple coins can be send by space separated.`,
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "from_address"}, {ProtoField: "to_address"}, {ProtoField: "amount", Varargs: true}},
},
{
Expand Down
2 changes: 1 addition & 1 deletion x/bank/migrations/v4/gen_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,6 @@ func TestMigrateGenState(t *testing.T) {
},
}
_ = v4.MigrateGenState(&origState)
assert.Len(t, origState.Params.SendEnabled, 2) //nolint:staticcheck // SA1019: keep for test
assert.Len(t, origState.Params.SendEnabled, 2) //nolint:staticcheck // keep for test
})
}
6 changes: 3 additions & 3 deletions x/circuit/autocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
Use: "authorize [grantee] [permissions_json] --from [granter]",
Short: "Authorize an account to trip the circuit breaker.",
Long: `Authorize an account to trip the circuit breaker.
"SOME_MSGS" = 1,
"ALL_MSGS" = 2,
"SUPER_ADMIN" = 3,`,
"SOME_MSGS" = 1,
"ALL_MSGS" = 2,
"SUPER_ADMIN" = 3,`,
Example: fmt.Sprintf(`%s circuit authorize [address] '{"level":1,"limit_type_urls":["cosmos.bank.v1beta1.MsgSend,cosmos.bank.v1beta1.MsgMultiSend"]}'"`, version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "grantee"},
Expand Down
5 changes: 0 additions & 5 deletions x/distribution/autocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ import (
"github.com/cosmos/cosmos-sdk/version"
)

var (
FlagCommission = "commission"
FlagMaxMessagesPerTx = "max-msgs"
)

// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
return &autocliv1.ModuleOptions{
Expand Down
7 changes: 2 additions & 5 deletions x/feegrant/module/autocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package module

import (
"fmt"
"strings"

autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
feegrantv1beta1 "cosmossdk.io/api/cosmos/feegrant/v1beta1"
Expand All @@ -19,10 +18,8 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcMethod: "Allowance",
Use: "grant [granter] [grantee]",
Short: "Query details of a single grant",
Long: strings.TrimSpace(
`Query details for a grant.
You can find the fee-grant of a granter and grantee.`),
Example: fmt.Sprintf(`$ %s query feegrant grant [granter] [grantee]`, version.AppName),
Long: "Query details for a grant. You can find the fee-grant of a granter and grantee.",
Example: fmt.Sprintf(`$ %s query feegrant grant [granter] [grantee]`, version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "granter"},
{ProtoField: "grantee"},
Expand Down
20 changes: 10 additions & 10 deletions x/group/module/autocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,16 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcMethod: "Vote",
Use: "vote [proposal-id] [voter] [vote-option] [metadata]",
Long: `Vote on a proposal.
Parameters:
proposal-id: unique ID of the proposal
voter: voter account addresses.
vote-option: choice of the voter(s)
VOTE_OPTION_UNSPECIFIED: no-op
VOTE_OPTION_NO: no
VOTE_OPTION_YES: yes
VOTE_OPTION_ABSTAIN: abstain
VOTE_OPTION_NO_WITH_VETO: no-with-veto
Metadata: metadata for the vote
Parameters:
proposal-id: unique ID of the proposal
voter: voter account addresses.
vote-option: choice of the voter(s)
VOTE_OPTION_UNSPECIFIED: no-op
VOTE_OPTION_NO: no
VOTE_OPTION_YES: yes
VOTE_OPTION_ABSTAIN: abstain
VOTE_OPTION_NO_WITH_VETO: no-with-veto
Metadata: metadata for the vote
`,
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "proposal_id"}, {ProtoField: "voter"}, {ProtoField: "option"}, {ProtoField: "metadata"},
Expand Down
1 change: 0 additions & 1 deletion x/staking/autocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcMethod: "HistoricalInfo",
Use: "historical-info [height]",
Short: "Query historical info at given height",
Long: "Query historical info at given height.",
Example: fmt.Sprintf("$ %s query staking historical-info 5", version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "height"},
Expand Down

0 comments on commit c81038c

Please sign in to comment.