From bdb9232ed819387cceef59fe635858ec985ff816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Francisco=20L=C3=B3pez?= Date: Wed, 21 Aug 2024 10:36:34 +0200 Subject: [PATCH] refactor(cli): Standardize `Use` field convention and update readme (#21369) --- .golangci.yml | 3 ++ client/debug/main.go | 10 ++--- client/grpc/cmtservice/autocli.go | 4 +- client/keys/show.go | 2 +- client/v2/README.md | 24 +++++++++++ client/v2/autocli/msg_test.go | 8 ++-- .../v2/autocli/testdata/help-echo-msg.golden | 2 +- server/cmt_cmds.go | 2 +- server/module_hash.go | 2 +- server/start.go | 2 +- .../client/grpc/cmtservice/autocli.go | 4 +- server/v2/cometbft/commands.go | 2 +- testutil/x/counter/autocli.go | 2 +- tools/confix/cmd/mutate.go | 4 +- tools/confix/cmd/view.go | 2 +- .../cosmovisor/cmd/cosmovisor/add_upgrade.go | 2 +- .../cosmovisor/cmd/cosmovisor/version_test.go | 2 +- tools/hubl/internal/remote.go | 2 +- x/accounts/cli/cli.go | 6 +-- x/auth/autocli.go | 12 +++--- x/auth/client/cli/broadcast.go | 2 +- x/auth/client/cli/decode.go | 2 +- x/auth/client/cli/encode.go | 2 +- x/auth/client/cli/query.go | 2 +- x/auth/client/cli/tx_multisign.go | 4 +- x/auth/client/cli/tx_sign.go | 4 +- x/auth/client/cli/tx_simulate.go | 2 +- x/auth/client/cli/validate_sigs.go | 2 +- x/authz/client/cli/tx.go | 6 +-- x/authz/module/autocli.go | 12 +++--- x/bank/autocli.go | 24 +++++------ x/bank/client/cli/tx.go | 2 +- x/circuit/autocli.go | 8 ++-- x/consensus/autocli.go | 2 +- x/distribution/autocli.go | 24 +++++------ x/evidence/autocli.go | 2 +- x/feegrant/client/cli/tx.go | 2 +- x/feegrant/module/autocli.go | 8 ++-- x/genutil/client/cli/genaccount.go | 2 +- x/genutil/client/cli/gentx.go | 2 +- x/genutil/client/cli/init.go | 2 +- x/genutil/client/cli/migrate.go | 2 +- x/gov/autocli.go | 24 +++++------ x/gov/client/cli/tx.go | 4 +- x/group/client/cli/tx.go | 12 +++--- x/group/module/autocli.go | 42 +++++++++---------- x/mint/autocli.go | 2 +- x/nft/module/autocli.go | 14 +++---- x/params/autocli.go | 2 +- x/params/client/cli/tx.go | 2 +- x/protocolpool/autocli.go | 12 +++--- x/slashing/autocli.go | 4 +- x/staking/autocli.go | 34 +++++++-------- x/staking/client/cli/tx.go | 2 +- x/upgrade/autocli.go | 2 +- x/upgrade/client/cli/tx.go | 2 +- 56 files changed, 200 insertions(+), 173 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index fc4dd038ba..158724cf53 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -76,6 +76,9 @@ issues: - text: "SA1019: params.SendEnabled is deprecated" # TODO remove once ready to remove from the sdk linters: - staticcheck + - text: "SA1029: Inappropriate key in context.WithValue" # TODO remove this when dependency is updated + linters: + - staticcheck - text: "leading space" linters: - nolintlint diff --git a/client/debug/main.go b/client/debug/main.go index f9f8a176f5..0cce37d16c 100644 --- a/client/debug/main.go +++ b/client/debug/main.go @@ -82,7 +82,7 @@ func getCodecInterfaces() *cobra.Command { // getCodecInterfaceImpls creates and returns a new cmd used for listing all registered implementations of a given interface on the application codec. func getCodecInterfaceImpls() *cobra.Command { return &cobra.Command{ - Use: "list-implementations [interface]", + Use: "list-implementations ", Short: "List the registered type URLs for the provided interface", Long: "List the registered type URLs that can be used for the provided interface name using the application codec", Example: fmt.Sprintf("%s debug codec list-implementations cosmos.crypto.PubKey", version.AppName), @@ -109,7 +109,7 @@ func getPubKeyFromString(ctx client.Context, pkstr string) (cryptotypes.PubKey, func PubkeyCmd() *cobra.Command { return &cobra.Command{ - Use: "pubkey [pubkey]", + Use: "pubkey ", Short: "Decode a pubkey from proto JSON", Long: "Decode a pubkey from proto JSON and display it's address.", Example: fmt.Sprintf(`%s debug pubkey '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AurroA7jvfPd1AadmmOvWM2rJSwipXfRf8yD6pLbA2DJ"}'`, version.AppName), @@ -181,7 +181,7 @@ func getPubKeyFromRawString(pkstr, keytype string) (cryptotypes.PubKey, error) { func PubkeyRawCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "pubkey-raw [pubkey] -t [{ed25519, secp256k1}]", + Use: "pubkey-raw [-t {ed25519, secp256k1}]", Short: "Decode a ED25519 or secp256k1 pubkey from hex, base64, or bech32", Long: "Decode a pubkey from hex, base64, or bech32.", Example: fmt.Sprintf(` @@ -247,7 +247,7 @@ func PubkeyRawCmd() *cobra.Command { func AddrCmd() *cobra.Command { return &cobra.Command{ - Use: "addr [address]", + Use: "addr
", Short: "Convert an address between hex and bech32", Example: fmt.Sprintf("%s debug addr cosmos1e0jnq2sun3dzjh8p2xq95kk0expwmd7shwjpfg", version.AppName), Args: cobra.ExactArgs(1), @@ -303,7 +303,7 @@ func AddrCmd() *cobra.Command { func RawBytesCmd() *cobra.Command { return &cobra.Command{ - Use: "raw-bytes [raw-bytes]", + Use: "raw-bytes ", Short: "Convert raw bytes output (eg. [10 21 13 255]) to hex", Long: "Convert raw-bytes to hex.", Example: fmt.Sprintf("%s debug raw-bytes [72 101 108 108 111 44 32 112 108 97 121 103 114 111 117 110 100]", version.AppName), diff --git a/client/grpc/cmtservice/autocli.go b/client/grpc/cmtservice/autocli.go index ea314c6f8c..6d8be1f229 100644 --- a/client/grpc/cmtservice/autocli.go +++ b/client/grpc/cmtservice/autocli.go @@ -25,7 +25,7 @@ var CometBFTAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{ }, { RpcMethod: "GetBlockByHeight", - Use: "block-by-height [height]", + Use: "block-by-height ", Short: "Query for a committed block by height", Long: "Query for a specific committed block using the CometBFT RPC `block_by_height` method", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "height"}}, @@ -38,7 +38,7 @@ var CometBFTAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{ }, { RpcMethod: "GetValidatorSetByHeight", - Use: "validator-set-by-height [height]", + Use: "validator-set-by-height ", Short: "Query for a validator set by height", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "height"}}, }, diff --git a/client/keys/show.go b/client/keys/show.go index 22c14ddaeb..0c418b6ed6 100644 --- a/client/keys/show.go +++ b/client/keys/show.go @@ -37,7 +37,7 @@ const ( // ShowKeysCmd shows key information for a given key name. func ShowKeysCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "show [name_or_address [name_or_address...]]", + Use: "show [name_or_address...]", Short: "Retrieve key information by name or address", Long: `Display keys details. If multiple names or addresses are provided, then an ephemeral multisig key will be created under the name "multi" diff --git a/client/v2/README.md b/client/v2/README.md index 478683ee36..9efc241748 100644 --- a/client/v2/README.md +++ b/client/v2/README.md @@ -131,6 +131,30 @@ AutoCLI can create a gov proposal of any tx by simply setting the `GovProposal` Users can however use the `--no-proposal` flag to disable the proposal creation (which is useful if the authority isn't the gov module on a chain). ::: +### Conventions for the `Use` field in Cobra + +According to the [Cobra documentation](https://pkg.go.dev/github.com/spf13/cobra#Command) the following conventions should be followed for the `Use` field in Cobra commands: + +1. **Required arguments**: + * Should not be enclosed in brackets. They can be enclosed in angle brackets `< >` for clarity. + * Example: `command ` + +2. **Optional arguments**: + * Should be enclosed in square brackets `[ ]`. + * Example: `command [optional_argument]` + +3. **Alternative (mutually exclusive) arguments**: + * Should be enclosed in curly braces `{ }`. + * Example: `command {-a | -b}` for required alternatives. + * Example: `command [-a | -b]` for optional alternatives. + +4. **Multiple arguments**: + * Indicated with `...` after the argument. + * Example: `command argument...` + +5. **Combination of options**: + * Example: `command [-F file | -D dir]... [-f format] profile` + ### Specifying Subcommands By default, `autocli` generates a command for each method in your gRPC service. However, you can specify subcommands to group related commands together. To specify subcommands, use the `autocliv1.ServiceCommandDescriptor` struct. diff --git a/client/v2/autocli/msg_test.go b/client/v2/autocli/msg_test.go index 2c08022fde..11e6fd2d2f 100644 --- a/client/v2/autocli/msg_test.go +++ b/client/v2/autocli/msg_test.go @@ -41,7 +41,7 @@ var bankAutoCLI = &autocliv1.ServiceCommandDescriptor{ RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "Send", - Use: "send [from_key_or_address] [to_address] [amount] [flags]", + Use: "send [flags]", Short: "Send coins from one account to another", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "from_address"}, {ProtoField: "to_address"}, {ProtoField: "amount"}}, }, @@ -64,7 +64,7 @@ func TestMsg(t *testing.T) { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "Send", - Use: "send [from_key_or_address] [to_address] [amount] [flags]", + Use: "send [flags]", Short: "Send coins from one account to another", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "from_address"}, {ProtoField: "to_address"}, {ProtoField: "amount"}}, }, @@ -83,7 +83,7 @@ func TestMsg(t *testing.T) { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "Send", - Use: "send [from_key_or_address] [to_address] [amount] [flags]", + Use: "send [flags]", Short: "Send coins from one account to another", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "to_address"}, {ProtoField: "amount"}}, // from_address should be automatically added @@ -104,7 +104,7 @@ func TestMsg(t *testing.T) { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "Send", - Use: "send [from_key_or_address] [to_address] [amount] [flags]", + Use: "send [flags]", Short: "Send coins from one account to another", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "to_address"}, {ProtoField: "amount"}}, FlagOptions: map[string]*autocliv1.FlagOptions{ diff --git a/client/v2/autocli/testdata/help-echo-msg.golden b/client/v2/autocli/testdata/help-echo-msg.golden index 91c5e678c4..1307509569 100644 --- a/client/v2/autocli/testdata/help-echo-msg.golden +++ b/client/v2/autocli/testdata/help-echo-msg.golden @@ -1,7 +1,7 @@ Send coins from one account to another Usage: - test send [from_key_or_address] [to_address] [amount] [flags] + test send [flags] Flags: -a, --account-number uint The account number of the signing account (offline mode only) diff --git a/server/cmt_cmds.go b/server/cmt_cmds.go index 6e13230e52..fc4f1c6f56 100644 --- a/server/cmt_cmds.go +++ b/server/cmt_cmds.go @@ -218,7 +218,7 @@ for. Each module documents its respective events under 'xx_events.md'. // QueryBlockCmd implements the default command for a Block query. func QueryBlockCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "block --type=[height|hash] [height|hash]", + Use: "block --type={height|hash} [height|hash]", Short: "Query for a committed block by height, hash, or event(s)", Long: "Query for a specific committed block using the CometBFT RPC `block` and `block_by_hash` method", Example: strings.TrimSpace(fmt.Sprintf(` diff --git a/server/module_hash.go b/server/module_hash.go index 966a291390..4b18355a85 100644 --- a/server/module_hash.go +++ b/server/module_hash.go @@ -21,7 +21,7 @@ import ( // ModuleHashByHeightQuery retrieves the module hashes at a given height. func ModuleHashByHeightQuery[T servertypes.Application](appCreator servertypes.AppCreator[T]) *cobra.Command { cmd := &cobra.Command{ - Use: "module-hash-by-height [height]", + Use: "module-hash-by-height ", Short: "Get module hashes at a given height", Long: "Get module hashes at a given height. This command is useful for debugging and verifying the state of the application at a given height. Daemon should not be running when calling this command.", Example: fmt.Sprintf("%s module-hash-by-height 16841115", version.AppName), diff --git a/server/start.go b/server/start.go index 37089246b8..0392c09b27 100644 --- a/server/start.go +++ b/server/start.go @@ -667,7 +667,7 @@ func InPlaceTestnetCreator[T types.Application](testnetAppCreator types.AppCreat } cmd := &cobra.Command{ - Use: "in-place-testnet [newChainID] [newOperatorAddress]", + Use: "in-place-testnet ", Short: "Create and start a testnet from current local state", Long: `Create and start a testnet from current local state. After utilizing this command the network will start. If the network is stopped, diff --git a/server/v2/cometbft/client/grpc/cmtservice/autocli.go b/server/v2/cometbft/client/grpc/cmtservice/autocli.go index ea314c6f8c..6d8be1f229 100644 --- a/server/v2/cometbft/client/grpc/cmtservice/autocli.go +++ b/server/v2/cometbft/client/grpc/cmtservice/autocli.go @@ -25,7 +25,7 @@ var CometBFTAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{ }, { RpcMethod: "GetBlockByHeight", - Use: "block-by-height [height]", + Use: "block-by-height ", Short: "Query for a committed block by height", Long: "Query for a specific committed block using the CometBFT RPC `block_by_height` method", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "height"}}, @@ -38,7 +38,7 @@ var CometBFTAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{ }, { RpcMethod: "GetValidatorSetByHeight", - Use: "validator-set-by-height [height]", + Use: "validator-set-by-height ", Short: "Query for a validator set by height", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "height"}}, }, diff --git a/server/v2/cometbft/commands.go b/server/v2/cometbft/commands.go index dac4fa63f8..ed8329731a 100644 --- a/server/v2/cometbft/commands.go +++ b/server/v2/cometbft/commands.go @@ -233,7 +233,7 @@ for. Each module documents its respective events under 'xx_events.md'. // QueryBlockCmd implements the default command for a Block query. func (s *CometBFTServer[T]) QueryBlockCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "block --type=[height|hash] [height|hash]", + Use: "block --type={height|hash} ", Short: "Query for a committed block by height, hash, or event(s)", Long: "Query for a specific committed block using the CometBFT RPC `block` and `block_by_hash` method", Example: strings.TrimSpace(fmt.Sprintf(` diff --git a/testutil/x/counter/autocli.go b/testutil/x/counter/autocli.go index 2067df6b81..572ec584e7 100644 --- a/testutil/x/counter/autocli.go +++ b/testutil/x/counter/autocli.go @@ -23,7 +23,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "IncreaseCount", - Use: "increase-count [count]", + Use: "increase-count ", Alias: []string{"increase-counter", "increase", "inc", "bump"}, Short: "Increase the counter by the specified amount", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "count"}}, diff --git a/tools/confix/cmd/mutate.go b/tools/confix/cmd/mutate.go index 772f38e7a8..9dd4a34ff0 100644 --- a/tools/confix/cmd/mutate.go +++ b/tools/confix/cmd/mutate.go @@ -20,7 +20,7 @@ import ( // SetCommand returns a CLI command to interactively update an application config value. func SetCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "set [config] [key] [value]", + Use: "set ", Short: "Set an application config value", Long: "Set an application config value. The [config] argument must be the path of the file when using the `confix` tool standalone, otherwise it must be the name of the config file without the .toml extension.", Args: cobra.ExactArgs(3), @@ -92,7 +92,7 @@ func SetCommand() *cobra.Command { // GetCommand returns a CLI command to interactively get an application config value. func GetCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "get [config] [key]", + Use: "get ", Short: "Get an application config value", Long: "Get an application config value. The [config] argument must be the path of the file when using the `confix` tool standalone, otherwise it must be the name of the config file without the .toml extension.", Args: cobra.ExactArgs(2), diff --git a/tools/confix/cmd/view.go b/tools/confix/cmd/view.go index 4c41c2963e..d88c685740 100644 --- a/tools/confix/cmd/view.go +++ b/tools/confix/cmd/view.go @@ -16,7 +16,7 @@ func ViewCommand() *cobra.Command { flagOutputFormat := "output-format" cmd := &cobra.Command{ - Use: "view [config]", + Use: "view ", Short: "View the config file", Long: "View the config file. The [config] argument must be the path of the file when using the `confix` tool standalone, otherwise it must be the name of the config file without the .toml extension.", Args: cobra.ExactArgs(1), diff --git a/tools/cosmovisor/cmd/cosmovisor/add_upgrade.go b/tools/cosmovisor/cmd/cosmovisor/add_upgrade.go index b188ab05fd..a197f33bc1 100644 --- a/tools/cosmovisor/cmd/cosmovisor/add_upgrade.go +++ b/tools/cosmovisor/cmd/cosmovisor/add_upgrade.go @@ -15,7 +15,7 @@ import ( func NewAddUpgradeCmd() *cobra.Command { addUpgrade := &cobra.Command{ - Use: "add-upgrade [upgrade-name] [path to executable]", + Use: "add-upgrade ", Short: "Add APP upgrade binary to cosmovisor", SilenceUsage: true, Args: cobra.ExactArgs(2), diff --git a/tools/cosmovisor/cmd/cosmovisor/version_test.go b/tools/cosmovisor/cmd/cosmovisor/version_test.go index 9f4cfb8960..47dcb06cc7 100644 --- a/tools/cosmovisor/cmd/cosmovisor/version_test.go +++ b/tools/cosmovisor/cmd/cosmovisor/version_test.go @@ -20,7 +20,7 @@ func TestVersionCommand_Error(t *testing.T) { rootCmd.SetOut(out) rootCmd.SetErr(out) - ctx := context.WithValue(context.Background(), log.ContextKey, logger) //nolint:staticcheck // temporary issue in dependency + ctx := context.WithValue(context.Background(), log.ContextKey, logger) //nolint:staticcheck // SA1029: temporary issue in dependency require.Error(t, rootCmd.ExecuteContext(ctx)) require.Contains(t, out.String(), "DAEMON_NAME is not set") diff --git a/tools/hubl/internal/remote.go b/tools/hubl/internal/remote.go index e792d6c1e6..0584c0800e 100644 --- a/tools/hubl/internal/remote.go +++ b/tools/hubl/internal/remote.go @@ -25,7 +25,7 @@ func InitCmd(config *config.Config, configDir string) *cobra.Command { var insecure bool cmd := &cobra.Command{ - Use: "init [foochain]", + Use: "init ", Short: "Initialize a new chain", Long: `To configure a new chain, run this command using the --init flag and the name of the chain as it's listed in the chain registry (https://github.com/cosmos/chain-registry). If the chain is not listed in the chain registry, you can use any unique name.`, diff --git a/x/accounts/cli/cli.go b/x/accounts/cli/cli.go index 12d7170ae8..e1458acbb0 100644 --- a/x/accounts/cli/cli.go +++ b/x/accounts/cli/cli.go @@ -41,7 +41,7 @@ func QueryCmd(name string) *cobra.Command { func GetTxInitCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "init [account-type] [json-message]", + Use: "init ", Short: "Initialize a new account", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { @@ -95,7 +95,7 @@ func GetTxInitCmd() *cobra.Command { func GetExecuteCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "execute [account-address] [execute-msg-type-url] [json-message]", + Use: "execute ", Short: "Execute state transition to account", Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { @@ -132,7 +132,7 @@ func GetExecuteCmd() *cobra.Command { func GetQueryAccountCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "query [account-address] [query-request-type-url] [json-message]", + Use: "query ", Short: "Query account state", Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/x/auth/autocli.go b/x/auth/autocli.go index 974daf4df5..676a3e4af7 100644 --- a/x/auth/autocli.go +++ b/x/auth/autocli.go @@ -24,19 +24,19 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "Account", - Use: "account [address]", + Use: "account
", Short: "Query account by address", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}}, }, { RpcMethod: "AccountInfo", - Use: "account-info [address]", + Use: "account-info
", Short: "Query account info which is common to all account types.", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}}, }, { RpcMethod: "AccountAddressByID", - Use: "address-by-acc-num [acc-num]", + Use: "address-by-acc-num ", Short: "Query account address by account number", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "id"}}, }, @@ -47,20 +47,20 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "ModuleAccountByName", - Use: "module-account [module-name]", + Use: "module-account ", Short: "Query module account info by module name", Example: fmt.Sprintf("%s q auth module-account gov", version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "name"}}, }, { RpcMethod: "AddressBytesToString", - Use: "address-bytes-to-string [address-bytes]", + Use: "address-bytes-to-string ", Short: "Transform an address bytes to string", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address_bytes"}}, }, { RpcMethod: "AddressStringToBytes", - Use: "address-string-to-bytes [address-string]", + Use: "address-string-to-bytes ", Short: "Transform an address string to bytes", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address_string"}}, }, diff --git a/x/auth/client/cli/broadcast.go b/x/auth/client/cli/broadcast.go index f110e459dd..dba2fedd5e 100644 --- a/x/auth/client/cli/broadcast.go +++ b/x/auth/client/cli/broadcast.go @@ -17,7 +17,7 @@ import ( // GetBroadcastCommand returns the tx broadcast command. func GetBroadcastCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "broadcast [file_path]", + Use: "broadcast ", Short: "Broadcast transactions generated offline", Long: strings.TrimSpace(`Broadcast transactions created with the --generate-only flag and signed with the sign command. Read a transaction from [file_path] and diff --git a/x/auth/client/cli/decode.go b/x/auth/client/cli/decode.go index 2d49806b12..0b6337bb77 100644 --- a/x/auth/client/cli/decode.go +++ b/x/auth/client/cli/decode.go @@ -16,7 +16,7 @@ const flagHex = "hex" // it into a JSON-encoded transaction. func GetDecodeCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "decode [protobuf-byte-string]", + Use: "decode ", Short: "Decode a binary encoded transaction string", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) (err error) { diff --git a/x/auth/client/cli/encode.go b/x/auth/client/cli/encode.go index dd677d4110..5046f61a7e 100644 --- a/x/auth/client/cli/encode.go +++ b/x/auth/client/cli/encode.go @@ -15,7 +15,7 @@ import ( // Amino-serialized bytes func GetEncodeCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "encode [file]", + Use: "encode ", Short: "Encode transactions generated offline", Long: `Encode transactions created with the --generate-only flag or signed with the sign command. Read a transaction from , serialize it to the Protobuf wire protocol, and output it as base64. diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index 93210ea7c7..273dd707f6 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -79,7 +79,7 @@ for. Each module documents its respective events under 'xx_events.md'. // QueryTxCmd implements the default command for a tx query. func QueryTxCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "tx --type=[hash|acc_seq|signature] [hash|acc_seq|signature]", + Use: "tx --type={hash|acc_seq|signature} ", Short: "Query for a transaction by hash, \"/\" combination or comma-separated signatures in a committed block", Long: strings.TrimSpace(fmt.Sprintf(` Example: diff --git a/x/auth/client/cli/tx_multisign.go b/x/auth/client/cli/tx_multisign.go index ced781fed8..d98cae0ca1 100644 --- a/x/auth/client/cli/tx_multisign.go +++ b/x/auth/client/cli/tx_multisign.go @@ -29,7 +29,7 @@ import ( // GetMultiSignCommand returns the multi-sign command func GetMultiSignCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "multi-sign [file] [name] [[signature]...]", + Use: "multi-sign [...]", Aliases: []string{"multisign"}, Short: "Generate multisig signatures for transactions generated offline", Long: strings.TrimSpace( @@ -211,7 +211,7 @@ func makeMultiSignCmd() func(cmd *cobra.Command, args []string) (err error) { func GetMultiSignBatchCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "multisign-batch [file] [name] [[signature-file]...]", + Use: "multisign-batch <[signature-file>...]", Aliases: []string{"multi-sign-batch"}, Short: "Assemble multisig transactions in batch from batch signatures", Long: strings.TrimSpace( diff --git a/x/auth/client/cli/tx_sign.go b/x/auth/client/cli/tx_sign.go index b4d062884c..a4057650d0 100644 --- a/x/auth/client/cli/tx_sign.go +++ b/x/auth/client/cli/tx_sign.go @@ -31,7 +31,7 @@ const ( // GetSignBatchCommand returns the transaction sign-batch command. func GetSignBatchCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "sign-batch [file] ([file2]...)", + Use: "sign-batch [...]", Short: "Sign transaction batch files", Long: `Sign batch files of transactions generated with --generate-only. The command processes list of transactions from a file (one StdTx each line), or multiple files. @@ -322,7 +322,7 @@ func setOutputFile(cmd *cobra.Command) (func(), error) { // GetSignCommand returns the transaction sign command. func GetSignCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "sign [file]", + Use: "sign ", Short: "Sign a transaction generated offline", Long: `Sign a transaction created with the --generate-only flag. It will read a transaction from [file], sign it, and print its JSON encoding. diff --git a/x/auth/client/cli/tx_simulate.go b/x/auth/client/cli/tx_simulate.go index daff57403f..ef570ebc82 100644 --- a/x/auth/client/cli/tx_simulate.go +++ b/x/auth/client/cli/tx_simulate.go @@ -16,7 +16,7 @@ import ( // successful. func GetSimulateCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "simulate /path/to/unsigned-tx.json --from keyname", + Use: "simulate --from ", Short: "Simulate the gas usage of a transaction", Long: strings.TrimSpace(`Simulate whether a transaction will be successful: diff --git a/x/auth/client/cli/validate_sigs.go b/x/auth/client/cli/validate_sigs.go index 0638f78c38..f5bc6cf4e7 100644 --- a/x/auth/client/cli/validate_sigs.go +++ b/x/auth/client/cli/validate_sigs.go @@ -20,7 +20,7 @@ import ( func GetValidateSignaturesCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "validate-signatures [file]", + Use: "validate-signatures ", Short: "validate transactions signatures", Long: `Print the addresses that must sign the transaction, those who have already signed it, and make sure that signatures are in the correct order. diff --git a/x/authz/client/cli/tx.go b/x/authz/client/cli/tx.go index e90d9a5b28..f8cc4b26a1 100644 --- a/x/authz/client/cli/tx.go +++ b/x/authz/client/cli/tx.go @@ -58,8 +58,8 @@ func GetTxCmd() *cobra.Command { // but it will be removed in future versions. func NewCmdExecAuthorization() *cobra.Command { cmd := &cobra.Command{ - Use: "legacy-exec [tx-json-file] --from [grantee]", - Short: "Execute tx on behalf of granter account. Deprecated, use exec instead.", + Use: "legacy-exec --from ", + Short: "Execute tx on behalf of granter account. Deprecated, use exec instead.", Example: fmt.Sprintf("$ %s tx authz exec tx.json --from grantee\n $ %[1]s tx bank send [granter] [recipient] [amount] --generate-only tx.json && %[1]s tx authz exec tx.json --from grantee", version.AppName), Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { @@ -95,7 +95,7 @@ func NewCmdExecAuthorization() *cobra.Command { // Migrating this command to AutoCLI is possible but would be CLI breaking. func NewCmdGrantAuthorization() *cobra.Command { cmd := &cobra.Command{ - Use: "grant [grantee] --from [granter]", + Use: "grant --from ", Short: "Grant authorization to an address", Long: fmt.Sprintf(`create a new grant authorization to an address to execute a transaction on your behalf: Examples: diff --git a/x/authz/module/autocli.go b/x/authz/module/autocli.go index 9ead5006c1..7f68728963 100644 --- a/x/authz/module/autocli.go +++ b/x/authz/module/autocli.go @@ -30,7 +30,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "GranterGrants", - Use: "grants-by-granter [granter-addr]", + Use: "grants-by-granter ", Short: "Query authorization grants granted by granter", PositionalArgs: []*autocliv1.PositionalArgDescriptor{ {ProtoField: "granter"}, @@ -38,7 +38,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "GranteeGrants", - Use: "grants-by-grantee [grantee-addr]", + Use: "grants-by-grantee ", Short: "Query authorization grants granted to a grantee", PositionalArgs: []*autocliv1.PositionalArgDescriptor{ {ProtoField: "grantee"}, @@ -52,7 +52,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "Exec", - Use: "exec [msg-json-file] --from [grantee]", + Use: "exec --from ", Short: "Execute tx on behalf of granter account", Example: fmt.Sprintf("$ %s tx authz exec msg.json --from grantee\n $ %[1]s tx bank send [granter] [recipient] [amount] --generate-only | jq .body.messages > msg.json && %[1]s tx authz exec msg.json --from grantee", version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ @@ -61,7 +61,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "Revoke", - Use: "revoke [grantee] [msg-type-url] --from [granter]", + Use: "revoke --from ", Short: `Revoke authorization from a granter to a grantee`, Example: fmt.Sprintf(`%s tx authz revoke cosmos1skj.. %s --from=cosmos1skj..`, version.AppName, bank.SendAuthorization{}.MsgTypeURL()), @@ -72,13 +72,13 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "RevokeAll", - Use: "revoke-all --from [signer]", + Use: "revoke-all --from ", Short: "Revoke all authorizations from the signer", Example: fmt.Sprintf("%s tx authz revoke-all --from=cosmos1skj..", version.AppName), }, { RpcMethod: "PruneExpiredGrants", - Use: "prune-grants --from [granter]", + Use: "prune-grants --from ", Short: "Prune expired grants", Long: "Prune up to 75 expired grants in order to reduce the size of the store when the number of expired grants is large.", Example: fmt.Sprintf(`$ %s tx authz prune-grants --from [mykey]`, version.AppName), diff --git a/x/bank/autocli.go b/x/bank/autocli.go index ead3aa80d8..cb3fc3cd9a 100644 --- a/x/bank/autocli.go +++ b/x/bank/autocli.go @@ -18,26 +18,26 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "Balance", - Use: "balance [address] [denom]", + Use: "balance
", Short: "Query an account balance by address and denom", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}, {ProtoField: "denom"}}, }, { RpcMethod: "AllBalances", - Use: "balances [address]", + Use: "balances
", Short: "Query for account balances by address", Long: "Query the total balance of an account or of a specific denomination.", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}}, }, { RpcMethod: "SpendableBalances", - Use: "spendable-balances [address]", + Use: "spendable-balances
", Short: "Query for account spendable balances by address", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}}, }, { RpcMethod: "SpendableBalanceByDenom", - Use: "spendable-balance [address] [denom]", + Use: "spendable-balance
", Short: "Query the spendable balance of a single denom for a single account.", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}, {ProtoField: "denom"}}, }, @@ -50,7 +50,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "SupplyOf", - Use: "total-supply-of [denom]", + Use: "total-supply-of ", Short: "Query the supply of a single coin denom", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "denom"}}, }, @@ -61,7 +61,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "DenomMetadata", - Use: "denom-metadata [denom]", + Use: "denom-metadata ", Short: "Query the client metadata of a given coin denomination", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "denom"}}, }, @@ -72,13 +72,13 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "DenomOwners", - Use: "denom-owners [denom]", + Use: "denom-owners ", Short: "Query for all account addresses that own a particular token denomination.", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "denom"}}, }, { RpcMethod: "SendEnabled", - Use: "send-enabled [denom1 ...]", + Use: "send-enabled ...", Short: "Query for send enabled entries", Long: strings.TrimSpace(`Query for send enabled entries that have been specifically set. @@ -95,7 +95,7 @@ To look up all denoms, do not provide any arguments.`, RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "Send", - Use: "send [from_key_or_address] [to_address] [amount ...]", + Use: "send ...", 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]. @@ -105,13 +105,13 @@ Note: multiple coins can be send by space separated.`, }, { RpcMethod: "Burn", - Use: "burn [from_key_or_address] [amount]", + Use: "burn ", Short: "Burns the amount specified from the given account.", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "from_address"}, {ProtoField: "amount", Varargs: true}}, }, { RpcMethod: "UpdateParams", - Use: "update-params-proposal [params]", + Use: "update-params-proposal ", Short: "Submit a proposal to update bank module params. Note: the entire params must be provided.", Example: fmt.Sprintf(`%s tx bank update-params-proposal '{ "default_send_enabled": true }'`, version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "params"}}, @@ -119,7 +119,7 @@ Note: multiple coins can be send by space separated.`, }, { RpcMethod: "SetSendEnabled", - Use: "set-send-enabled-proposal [send_enabled]", + Use: "set-send-enabled-proposal ", Short: "Submit a proposal to set/update/delete send enabled entries", Example: fmt.Sprintf(`%s tx bank set-send-enabled-proposal '{"denom":"stake","enabled":true}'`, version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "send_enabled", Varargs: true}}, diff --git a/x/bank/client/cli/tx.go b/x/bank/client/cli/tx.go index 1e86b92f75..3d537522eb 100644 --- a/x/bank/client/cli/tx.go +++ b/x/bank/client/cli/tx.go @@ -39,7 +39,7 @@ func NewTxCmd() *cobra.Command { // For a better UX this command is limited to send funds from one account to two or more accounts. func NewMultiSendTxCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "multi-send [from_key_or_address] [to_address_1 to_address_2 ...] [amount]", + Use: "multi-send ... ", Short: "Send funds from one account to two or more accounts.", Long: `Send funds from one account to two or more accounts. By default, sends the [amount] to each address of the list. diff --git a/x/circuit/autocli.go b/x/circuit/autocli.go index de72b3dc28..e9055caf51 100644 --- a/x/circuit/autocli.go +++ b/x/circuit/autocli.go @@ -16,7 +16,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "Account", - Use: "account [address]", + Use: "account
", Short: "Query a specific account's permissions", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}}, }, @@ -37,7 +37,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "AuthorizeCircuitBreaker", - Use: "authorize [grantee] [permissions_json] --from [granter]", + Use: "authorize --from ", Short: "Authorize an account to trip the circuit breaker.", Long: `Authorize an account to trip the circuit breaker. "SOME_MSGS" = 1, @@ -51,7 +51,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "TripCircuitBreaker", - Use: "disable [msg_type_urls]", + Use: "disable ", Short: "Disable a message from being executed", Example: fmt.Sprintf(`%s circuit disable "cosmos.bank.v1beta1.MsgSend cosmos.bank.v1beta1.MsgMultiSend"`, version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ @@ -60,7 +60,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "ResetCircuitBreaker", - Use: "reset [msg_type_urls]", + Use: "reset ", Short: "Enable a message to be executed", Example: fmt.Sprintf(`%s circuit reset "cosmos.bank.v1beta1.MsgSend cosmos.bank.v1beta1.MsgMultiSend"`, version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ diff --git a/x/consensus/autocli.go b/x/consensus/autocli.go index 14784dced7..e9c89ca63f 100644 --- a/x/consensus/autocli.go +++ b/x/consensus/autocli.go @@ -31,7 +31,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "UpdateParams", - Use: "update-params-proposal [params]", + Use: "update-params-proposal ", Short: "Submit a proposal to update consensus module params. Note: the entire params must be provided.", Example: fmt.Sprintf(`%s tx consensus update-params-proposal '{ params }'`, version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ diff --git a/x/distribution/autocli.go b/x/distribution/autocli.go index c53abc4eda..d793f2626d 100644 --- a/x/distribution/autocli.go +++ b/x/distribution/autocli.go @@ -22,7 +22,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "ValidatorDistributionInfo", - Use: "validator-distribution-info [validator]", + Use: "validator-distribution-info ", Short: "Query validator distribution info", Example: fmt.Sprintf(`Example: $ %s query distribution validator-distribution-info [validator-address]`, version.AppName), @@ -32,7 +32,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "ValidatorOutstandingRewards", - Use: "validator-outstanding-rewards [validator]", + Use: "validator-outstanding-rewards ", Short: "Query distribution outstanding (un-withdrawn) rewards for a validator and all their delegations", Example: fmt.Sprintf(`$ %s query distribution validator-outstanding-rewards [validator-address]`, version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ @@ -41,7 +41,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "ValidatorCommission", - Use: "commission [validator]", + Use: "commission ", Short: "Query distribution validator commission", Example: fmt.Sprintf(`$ %s query distribution commission [validator-address]`, version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ @@ -50,7 +50,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "ValidatorSlashes", - Use: "slashes [validator] [start-height] [end-height]", + Use: "slashes ", Short: "Query distribution validator slashes", Example: fmt.Sprintf(`$ %s query distribution slashes [validator-address] 0 100`, version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ @@ -61,7 +61,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "DelegationRewards", - Use: "rewards-by-validator [delegator-addr] [validator-addr]", + Use: "rewards-by-validator ", Short: "Query all distribution delegator from a particular validator", Example: fmt.Sprintf("$ %s query distribution rewards [delegator-address] [validator-address]", version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ @@ -71,7 +71,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "DelegationTotalRewards", - Use: "rewards [delegator-addr]", + Use: "rewards ", Short: "Query all distribution delegator rewards", Long: "Query all rewards earned by a delegator", Example: fmt.Sprintf("$ %s query distribution rewards [delegator-address]", version.AppName), @@ -92,7 +92,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "SetWithdrawAddress", - Use: "set-withdraw-addr [withdraw-addr]", + Use: "set-withdraw-addr ", Short: "Change the default withdraw address for rewards associated with an address", Example: fmt.Sprintf("%s tx distribution set-withdraw-addr cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p --from mykey", version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ @@ -101,7 +101,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "WithdrawDelegatorReward", - Use: "withdraw-rewards [validator-addr]", + Use: "withdraw-rewards ", Short: "Withdraw rewards from a given delegation address", PositionalArgs: []*autocliv1.PositionalArgDescriptor{ {ProtoField: "validator_address"}, @@ -109,7 +109,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "WithdrawValidatorCommission", - Use: "withdraw-validator-commission [validator-addr]", + Use: "withdraw-validator-commission ", Short: "Withdraw commissions from a validator address (must be a validator operator)", PositionalArgs: []*autocliv1.PositionalArgDescriptor{ {ProtoField: "validator_address"}, @@ -117,7 +117,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "DepositValidatorRewardsPool", - Use: "fund-validator-rewards-pool [validator-addr] [amount]", + Use: "fund-validator-rewards-pool ", Short: "Fund the validator rewards pool with the specified amount", Example: fmt.Sprintf("%s tx distribution fund-validator-rewards-pool cosmosvaloper1x20lytyf6zkcrv5edpkfkn8sz578qg5sqfyqnp 100uatom --from mykey", version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ @@ -128,7 +128,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { { RpcMethod: "FundCommunityPool", Deprecated: fmt.Sprintf("Use %s tx protocolpool fund-community-pool", version.AppName), - Use: "fund-community-pool [amount]", + Use: "fund-community-pool ", Short: "Funds the community pool with the specified amount", Example: fmt.Sprintf(`$ %s tx distribution fund-community-pool 100uatom --from mykey`, version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ @@ -137,7 +137,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "UpdateParams", - Use: "update-params-proposal [params]", + Use: "update-params-proposal ", Short: "Submit a proposal to update distribution module params. Note: the entire params must be provided.", Example: fmt.Sprintf(`%s tx distribution update-params-proposal '{ "community_tax": "20000", "base_proposer_reward": "0", "bonus_proposer_reward": "0", "withdraw_addr_enabled": true }'`, version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "params"}}, diff --git a/x/evidence/autocli.go b/x/evidence/autocli.go index cd3fda9bce..4a239beb9d 100644 --- a/x/evidence/autocli.go +++ b/x/evidence/autocli.go @@ -17,7 +17,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "Evidence", - Use: "evidence [hash]", + Use: "evidence ", Short: "Query for evidence by hash", Example: fmt.Sprintf("%s query evidence DF0C23E8634E480F84B9D5674A7CDC9816466DEC28A3358F73260F68D28D7660", version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "hash"}}, diff --git a/x/feegrant/client/cli/tx.go b/x/feegrant/client/cli/tx.go index 00c3339b15..2ba342b21a 100644 --- a/x/feegrant/client/cli/tx.go +++ b/x/feegrant/client/cli/tx.go @@ -48,7 +48,7 @@ func GetTxCmd() *cobra.Command { // This command is more powerful than AutoCLI generated command as it allows a better input validation. func NewCmdFeeGrant() *cobra.Command { cmd := &cobra.Command{ - Use: "grant [granter_key_or_address] [grantee]", + Use: "grant ", Aliases: []string{"grant-allowance"}, Short: "Grant Fee allowance to an address", Long: strings.TrimSpace( diff --git a/x/feegrant/module/autocli.go b/x/feegrant/module/autocli.go index f3bbd05977..e8fe235fce 100644 --- a/x/feegrant/module/autocli.go +++ b/x/feegrant/module/autocli.go @@ -16,7 +16,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "Allowance", - Use: "grant [granter] [grantee]", + Use: "grant ", Short: "Query details of a single grant", 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), @@ -27,7 +27,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "Allowances", - Use: "grants-by-grantee [grantee]", + Use: "grants-by-grantee ", Short: "Query all grants of a grantee", Long: "Queries all the grants for a grantee address.", Example: fmt.Sprintf(`$ %s query feegrant grants-by-grantee [grantee]`, version.AppName), @@ -37,7 +37,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "AllowancesByGranter", - Use: "grants-by-granter [granter]", + Use: "grants-by-granter ", Short: "Query all grants by a granter", Example: fmt.Sprintf(`$ %s query feegrant grants-by-granter [granter]`, version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ @@ -51,7 +51,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "RevokeAllowance", - Use: "revoke [granter] [grantee]", + Use: "revoke ", Short: "Revoke a fee grant", Long: "Revoke fee grant from a granter to a grantee. Note, the '--from' flag is ignored as it is implied from [granter]", Example: fmt.Sprintf(`$ %s tx feegrant revoke [granter] [grantee]`, version.AppName), diff --git a/x/genutil/client/cli/genaccount.go b/x/genutil/client/cli/genaccount.go index bafd4f2f94..34acef113e 100644 --- a/x/genutil/client/cli/genaccount.go +++ b/x/genutil/client/cli/genaccount.go @@ -25,7 +25,7 @@ const ( // This command is provided as a default, applications are expected to provide their own command if custom genesis accounts are needed. func AddGenesisAccountCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]", + Use: "add-genesis-account [,...]", Short: "Add a genesis account to genesis.json", Long: `Add a genesis account to genesis.json. The provided account must specify the account address or key name and a list of initial coins. If a key name is given, diff --git a/x/genutil/client/cli/gentx.go b/x/genutil/client/cli/gentx.go index 8e13028633..dfeda2df59 100644 --- a/x/genutil/client/cli/gentx.go +++ b/x/genutil/client/cli/gentx.go @@ -32,7 +32,7 @@ func GenTxCmd(genMM genesisMM, genBalIterator types.GenesisBalancesIterator) *co fsCreateValidator, defaultsDesc := cli.CreateValidatorMsgFlagSet(ipDefault) cmd := &cobra.Command{ - Use: "gentx [key_name] [amount]", + Use: "gentx ", Short: "Generate a genesis tx carrying a self delegation", Args: cobra.ExactArgs(2), Long: fmt.Sprintf(`Generate a genesis transaction that creates a validator with a self-delegation, diff --git a/x/genutil/client/cli/init.go b/x/genutil/client/cli/init.go index 557050b10a..8217e87443 100644 --- a/x/genutil/client/cli/init.go +++ b/x/genutil/client/cli/init.go @@ -73,7 +73,7 @@ func displayInfo(dst io.Writer, info printInfo) error { // and the respective application. func InitCmd(mm genesisMM) *cobra.Command { cmd := &cobra.Command{ - Use: "init [moniker]", + Use: "init ", Short: "Initialize private validator, p2p, genesis, and application configuration files", Long: `Initialize validators's and node's configuration files.`, Args: cobra.ExactArgs(1), diff --git a/x/genutil/client/cli/migrate.go b/x/genutil/client/cli/migrate.go index 08eb01ced8..2763ba06cf 100644 --- a/x/genutil/client/cli/migrate.go +++ b/x/genutil/client/cli/migrate.go @@ -26,7 +26,7 @@ var MigrationMap = types.MigrationMap{} // When the application migration includes a SDK migration, the Cosmos SDK migration function should as well be called. func MigrateGenesisCmd(migrations types.MigrationMap) *cobra.Command { cmd := &cobra.Command{ - Use: "migrate [target-version] [genesis-file]", + Use: "migrate ", Short: "Migrate genesis to a specified target version", Long: "Migrate the source genesis into the target version and print to STDOUT", Example: fmt.Sprintf("%s migrate v0.47 /path/to/genesis.json --chain-id=cosmoshub-3 --genesis-time=2019-04-22T17:00:00Z", version.AppName), diff --git a/x/gov/autocli.go b/x/gov/autocli.go index 26508fb798..b0f97e48c0 100644 --- a/x/gov/autocli.go +++ b/x/gov/autocli.go @@ -22,7 +22,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "MessageBasedParams", - Use: "params-by-msg-url [msg-url]", + Use: "params-by-msg-url ", Short: "Query the governance parameters of specific message", PositionalArgs: []*autocliv1.PositionalArgDescriptor{ {ProtoField: "msg_url"}, @@ -36,7 +36,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "Proposal", - Use: "proposal [proposal-id]", + Use: "proposal ", Alias: []string{"proposer"}, Short: "Query details of a single proposal", Example: fmt.Sprintf("%s query gov proposal 1", version.AppName), @@ -46,7 +46,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "Vote", - Use: "vote [proposal-id] [voter-addr]", + Use: "vote ", Short: "Query details of a single vote", Example: fmt.Sprintf("%s query gov vote 1 cosmos1...", version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ @@ -56,7 +56,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "Votes", - Use: "votes [proposal-id]", + Use: "votes ", Short: "Query votes of a single proposal", Example: fmt.Sprintf("%s query gov votes 1", version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ @@ -65,7 +65,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "Deposit", - Use: "deposit [proposal-id] [depositor-addr]", + Use: "deposit ", Short: "Query details of a deposit", PositionalArgs: []*autocliv1.PositionalArgDescriptor{ {ProtoField: "proposal_id"}, @@ -74,7 +74,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "Deposits", - Use: "deposits [proposal-id]", + Use: "deposits ", Short: "Query deposits on a proposal", PositionalArgs: []*autocliv1.PositionalArgDescriptor{ {ProtoField: "proposal_id"}, @@ -82,7 +82,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "TallyResult", - Use: "tally [proposal-id]", + Use: "tally ", Short: "Query the tally of a proposal vote", Example: fmt.Sprintf("%s query gov tally 1", version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ @@ -102,7 +102,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "Deposit", - Use: "deposit [proposal-id] [deposit]", + Use: "deposit ", Short: "Deposit tokens for an active proposal", Long: fmt.Sprintf(`Submit a deposit for an active proposal. You can find the proposal-id by running "%s query gov proposals"`, version.AppName), Example: fmt.Sprintf(`$ %s tx gov deposit 1 10stake --from mykey`, version.AppName), @@ -113,7 +113,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "CancelProposal", - Use: "cancel-proposal [proposal-id]", + Use: "cancel-proposal ", Short: "Cancel governance proposal before the voting period ends. Must be signed by the proposal creator.", Example: fmt.Sprintf(`$ %s tx gov cancel-proposal 1 --from mykey`, version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ @@ -122,7 +122,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "Vote", - Use: "vote [proposal-id] [option]", + Use: "vote