refactor(cli): Standardize Use field convention and update readme (#21369)

This commit is contained in:
Lucas Francisco López 2024-08-21 10:36:34 +02:00 committed by GitHub
parent 95dcf845c3
commit bdb9232ed8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
56 changed files with 200 additions and 173 deletions

View File

@ -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

View File

@ -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 <interface>",
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 <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 <pubkey> [-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 <address>",
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 <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),

View File

@ -25,7 +25,7 @@ var CometBFTAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{
},
{
RpcMethod: "GetBlockByHeight",
Use: "block-by-height [height]",
Use: "block-by-height <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 <height>",
Short: "Query for a validator set by height",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "height"}},
},

View File

@ -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> [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"

View File

@ -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 <required_argument>`
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.

View File

@ -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 <from_key_or_address> <to_address> <amount> [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 <from_key_or_address> <to_address> <amount> [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 <from_key_or_address> <to_address> <amount> [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 <from_key_or_address> <to_address> <amount> [flags]",
Short: "Send coins from one account to another",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "to_address"}, {ProtoField: "amount"}},
FlagOptions: map[string]*autocliv1.FlagOptions{

View File

@ -1,7 +1,7 @@
Send coins from one account to another
Usage:
test send [from_key_or_address] [to_address] [amount] [flags]
test send <from_key_or_address> <to_address> <amount> [flags]
Flags:
-a, --account-number uint The account number of the signing account (offline mode only)

View File

@ -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(`

View File

@ -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 <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),

View File

@ -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 <newChainID> <newOperatorAddress>",
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,

View File

@ -25,7 +25,7 @@ var CometBFTAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{
},
{
RpcMethod: "GetBlockByHeight",
Use: "block-by-height [height]",
Use: "block-by-height <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 <height>",
Short: "Query for a validator set by height",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "height"}},
},

View File

@ -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} <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(`

View File

@ -23,7 +23,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "IncreaseCount",
Use: "increase-count [count]",
Use: "increase-count <count>",
Alias: []string{"increase-counter", "increase", "inc", "bump"},
Short: "Increase the counter by the specified amount",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "count"}},

View File

@ -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 <config> <key> <value>",
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 <config> <key>",
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),

View File

@ -16,7 +16,7 @@ func ViewCommand() *cobra.Command {
flagOutputFormat := "output-format"
cmd := &cobra.Command{
Use: "view [config]",
Use: "view <config>",
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),

View File

@ -15,7 +15,7 @@ import (
func NewAddUpgradeCmd() *cobra.Command {
addUpgrade := &cobra.Command{
Use: "add-upgrade [upgrade-name] [path to executable]",
Use: "add-upgrade <upgrade-name> <path to executable>",
Short: "Add APP upgrade binary to cosmovisor",
SilenceUsage: true,
Args: cobra.ExactArgs(2),

View File

@ -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")

View File

@ -25,7 +25,7 @@ func InitCmd(config *config.Config, configDir string) *cobra.Command {
var insecure bool
cmd := &cobra.Command{
Use: "init [foochain]",
Use: "init <foochain>",
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.`,

View File

@ -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 <account-type> <json-message>",
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 <account-address> <execute-msg-type-url> <json-message>",
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 <account-address> <query-request-type-url> <json-message>",
Short: "Query account state",
Args: cobra.ExactArgs(3),
RunE: func(cmd *cobra.Command, args []string) error {

View File

@ -24,19 +24,19 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "Account",
Use: "account [address]",
Use: "account <address>",
Short: "Query account by address",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}},
},
{
RpcMethod: "AccountInfo",
Use: "account-info [address]",
Use: "account-info <address>",
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 <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 <module-name>",
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 <address-bytes>",
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 <address-string>",
Short: "Transform an address string to bytes",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address_string"}},
},

View File

@ -17,7 +17,7 @@ import (
// GetBroadcastCommand returns the tx broadcast command.
func GetBroadcastCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "broadcast [file_path]",
Use: "broadcast <file_path>",
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

View File

@ -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 <protobuf-byte-string>",
Short: "Decode a binary encoded transaction string",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) (err error) {

View File

@ -15,7 +15,7 @@ import (
// Amino-serialized bytes
func GetEncodeCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "encode [file]",
Use: "encode <file>",
Short: "Encode transactions generated offline",
Long: `Encode transactions created with the --generate-only flag or signed with the sign command.
Read a transaction from <file>, serialize it to the Protobuf wire protocol, and output it as base64.

View File

@ -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} <hash|acc_seq|signature>",
Short: "Query for a transaction by hash, \"<addr>/<seq>\" combination or comma-separated signatures in a committed block",
Long: strings.TrimSpace(fmt.Sprintf(`
Example:

View File

@ -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 <file> <name> [<signature>...]",
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 <file> <name> <[signature-file>...]",
Aliases: []string{"multi-sign-batch"},
Short: "Assemble multisig transactions in batch from batch signatures",
Long: strings.TrimSpace(

View File

@ -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 <file> [<file2>...]",
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 <file>",
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.

View File

@ -16,7 +16,7 @@ import (
// successful.
func GetSimulateCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "simulate /path/to/unsigned-tx.json --from keyname",
Use: "simulate <path/to/unsigned-tx.json> --from <keyname>",
Short: "Simulate the gas usage of a transaction",
Long: strings.TrimSpace(`Simulate whether a transaction will be successful:

View File

@ -20,7 +20,7 @@ import (
func GetValidateSignaturesCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "validate-signatures [file]",
Use: "validate-signatures <file>",
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.

View File

@ -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 <tx-json-file> --from <grantee>",
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] <authorization_type=\"send\"|\"generic\"|\"delegate\"|\"unbond\"|\"redelegate\"> --from [granter]",
Use: "grant <grantee> <authorization_type=\"send\"|\"generic\"|\"delegate\"|\"unbond\"|\"redelegate\"> --from <granter>",
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:

View File

@ -30,7 +30,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "GranterGrants",
Use: "grants-by-granter [granter-addr]",
Use: "grants-by-granter <granter-addr>",
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 <grantee-addr>",
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 <msg-json-file> --from <grantee>",
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 <grantee> <msg-type-url> --from <granter>",
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 <signer>",
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 <granter>",
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),

View File

@ -18,26 +18,26 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Balance",
Use: "balance [address] [denom]",
Use: "balance <address> <denom>",
Short: "Query an account balance by address and denom",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}, {ProtoField: "denom"}},
},
{
RpcMethod: "AllBalances",
Use: "balances [address]",
Use: "balances <address>",
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 <address>",
Short: "Query for account spendable balances by address",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}},
},
{
RpcMethod: "SpendableBalanceByDenom",
Use: "spendable-balance [address] [denom]",
Use: "spendable-balance <address> <denom>",
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 <denom>",
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 <denom>",
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 <denom>",
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 <denom1>...",
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 <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].
@ -105,13 +105,13 @@ Note: multiple coins can be send by space separated.`,
},
{
RpcMethod: "Burn",
Use: "burn [from_key_or_address] [amount]",
Use: "burn <from_key_or_address> <amount>",
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 <params>",
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 <send_enabled>",
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}},

View File

@ -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 <from_key_or_address> <to_address_1> <to_address_2>... <amount>",
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.

View File

@ -16,7 +16,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Account",
Use: "account [address]",
Use: "account <address>",
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 <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,
@ -51,7 +51,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "TripCircuitBreaker",
Use: "disable [msg_type_urls]",
Use: "disable <msg_type_urls>",
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 <msg_type_urls>",
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{

View File

@ -31,7 +31,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "UpdateParams",
Use: "update-params-proposal [params]",
Use: "update-params-proposal <params>",
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{

View File

@ -22,7 +22,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "ValidatorDistributionInfo",
Use: "validator-distribution-info [validator]",
Use: "validator-distribution-info <validator>",
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 <validator>",
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 <validator>",
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 <validator> <start-height> <end-height>",
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 <delegator-addr> <validator-addr>",
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 <delegator-addr>",
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 <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 <validator-addr>",
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 <validator-addr>",
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 <validator-addr> <amount>",
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 <amount>",
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 <params>",
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"}},

View File

@ -17,7 +17,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Evidence",
Use: "evidence [hash]",
Use: "evidence <hash>",
Short: "Query for evidence by hash",
Example: fmt.Sprintf("%s query evidence DF0C23E8634E480F84B9D5674A7CDC9816466DEC28A3358F73260F68D28D7660", version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "hash"}},

View File

@ -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 <granter_key_or_address> <grantee>",
Aliases: []string{"grant-allowance"},
Short: "Grant Fee allowance to an address",
Long: strings.TrimSpace(

View File

@ -16,7 +16,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Allowance",
Use: "grant [granter] [grantee]",
Use: "grant <granter> <grantee>",
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 <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 <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 <granter> <grantee>",
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),

View File

@ -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 <address_or_key_name> <coin>[,<coin>...]",
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,

View File

@ -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 <key_name> <amount>",
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,

View File

@ -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 <moniker>",
Short: "Initialize private validator, p2p, genesis, and application configuration files",
Long: `Initialize validators's and node's configuration files.`,
Args: cobra.ExactArgs(1),

View File

@ -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 <target-version> <genesis-file>",
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),

View File

@ -22,7 +22,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "MessageBasedParams",
Use: "params-by-msg-url [msg-url]",
Use: "params-by-msg-url <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 <proposal-id>",
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 <proposal-id> <voter-addr>",
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 <proposal-id>",
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 <proposal-id> <depositor-addr>",
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 <proposal-id>",
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 <proposal-id>",
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 <proposal-id> <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 <proposal-id>",
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 <proposal-id> <option>",
Short: "Vote for an active proposal, options: yes/no/no-with-veto/abstain",
Long: fmt.Sprintf(`Submit a vote for an active proposal. Use the --metadata to optionally give a reason. You can find the proposal-id by running "%s query gov proposals"`, version.AppName),
Example: fmt.Sprintf("$ %s tx gov vote 1 yes --from mykey", version.AppName),
@ -136,7 +136,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "UpdateParams",
Use: "update-params-proposal [params]",
Use: "update-params-proposal <params>",
Short: "Submit a proposal to update gov module params. Note: the entire params must be provided.",
Long: fmt.Sprintf("Submit a proposal to update gov module params. Note: the entire params must be provided.\n See the fields to fill in by running `%s query gov params --output json`", version.AppName),
Example: fmt.Sprintf(`%s tx gov update-params-proposal '{ params }'`, version.AppName),
@ -145,7 +145,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "UpdateMessageParams",
Use: "update-params-msg-url-params [msg-url] [msg-params]",
Use: "update-params-msg-url-params <msg-url> <msg-params>",
Short: "Submit a proposal to update gov module message params. Note: the entire params must be provided.",
Example: fmt.Sprintf(`%s tx gov update-msg-params-proposal [msg-url]'{ params }'`, version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{

View File

@ -83,7 +83,7 @@ func NewTxCmd(legacyPropCmds []*cobra.Command) *cobra.Command {
// NewCmdSubmitProposal implements submitting a proposal transaction command.
func NewCmdSubmitProposal() *cobra.Command {
cmd := &cobra.Command{
Use: "submit-proposal [path/to/proposal.json]",
Use: "submit-proposal <path/to/proposal.json>",
Short: "Submit a proposal along with some messages, metadata and deposit",
Args: cobra.ExactArgs(1),
Long: strings.TrimSpace(
@ -236,7 +236,7 @@ $ %s tx gov submit-legacy-proposal --title="Test Proposal" --description="My awe
// TODO(@julienrbrt): remove this once AutoCLI can flatten nested structs.
func NewCmdWeightedVote() *cobra.Command {
cmd := &cobra.Command{
Use: "weighted-vote [proposal-id] [weighted-options]",
Use: "weighted-vote <proposal-id> <weighted-options>",
Aliases: []string{"vote-weighted"},
Args: cobra.ExactArgs(2),
Short: "Vote for an active proposal, options: yes/no/no-with-veto/abstain",

View File

@ -52,7 +52,7 @@ func TxCmd(name string) *cobra.Command {
// This command is being handled better here, not converting to autocli
func MsgCreateGroupCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "create-group [admin] [metadata] [members-json-file]",
Use: "create-group <admin> <metadata> <members-json-file>",
Short: "Create a group which is an aggregation of member accounts with associated weights and an administrator account.",
Long: `Create a group which is an aggregation of member accounts with associated weights and an administrator account.
Note, the '--from' flag is ignored as it is implied from [admin]. Members accounts can be given through a members JSON file that contains an array of members.`,
@ -123,7 +123,7 @@ Where members.json contains:
// This command is being handled better here, not converting to autocli
func MsgUpdateGroupMembersCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "update-group-members [admin] [group-id] [members-json-file]",
Use: "update-group-members <admin> <group-id> <members-json-file>",
Short: "Update a group's members. Set a member's weight to \"0\" to delete it.",
Example: fmt.Sprintf(`
%s tx group update-group-members [admin] [group-id] [members-json-file]
@ -204,7 +204,7 @@ Set a member's weight to "0" to delete it.
// This command is being handled better here, not converting to autocli
func MsgCreateGroupWithPolicyCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "create-group-with-policy [admin] [group-metadata] [group-policy-metadata] [members-json-file] [decision-policy-json-file]",
Use: "create-group-with-policy <admin> <group-metadata> <group-policy-metadata> <members-json-file> <decision-policy-json-file>",
Short: "Create a group with policy which is an aggregation of member accounts with associated weights, an administrator account and decision policy.",
Long: `Create a group with policy which is an aggregation of member accounts with associated weights,
an administrator account and decision policy. Note, the '--from' flag is ignored as it is implied from [admin].
@ -309,7 +309,7 @@ and policy.json contains:
// This command is being handled better here, not converting to autocli
func MsgCreateGroupPolicyCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "create-group-policy [admin] [group-id] [metadata] [decision-policy-json-file]",
Use: "create-group-policy <admin> <group-id> <metadata> <decision-policy-json-file>",
Short: `Create a group policy which is an account associated with a group and a decision policy. Note, the '--from' flag is ignored as it is implied from [admin].`,
Example: fmt.Sprintf(`
%s tx group create-group-policy [admin] [group-id] [metadata] policy.json
@ -394,7 +394,7 @@ Here, we can use percentage decision policy when needed, where 0 < percentage <=
// This command is being handled better here, not converting to autocli
func MsgUpdateGroupPolicyDecisionPolicyCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "update-group-policy-decision-policy [admin] [group-policy-account] [decision-policy-json-file]",
Use: "update-group-policy-decision-policy <admin> <group-policy-account> <decision-policy-json-file>",
Short: "Update a group policy's decision policy",
Args: cobra.ExactArgs(3),
RunE: func(cmd *cobra.Command, args []string) error {
@ -450,7 +450,7 @@ func MsgUpdateGroupPolicyDecisionPolicyCmd() *cobra.Command {
// This command is being handled better here, not converting to autocli
func MsgSubmitProposalCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "submit-proposal [proposal_json_file]",
Use: "submit-proposal <proposal_json_file>",
Short: "Submit a new proposal",
Long: `Submit a new proposal.
Parameters:

View File

@ -13,7 +13,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "GroupInfo",
Use: "group-info [group-id]",
Use: "group-info <group-id>",
Short: "Query for group info by group id",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "group_id"},
@ -21,7 +21,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "GroupPolicyInfo",
Use: "group-policy-info [group-policy-account]",
Use: "group-policy-info <group-policy-account>",
Short: "Query for group policy info by account address of group policy",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "address"},
@ -29,7 +29,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "GroupMembers",
Use: "group-members [group-id]",
Use: "group-members <group-id>",
Short: "Query for group members by group id",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "group_id"},
@ -37,7 +37,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "GroupsByAdmin",
Use: "groups-by-admin [admin]",
Use: "groups-by-admin <admin>",
Short: "Query for groups by admin account address",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "admin"},
@ -45,7 +45,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "GroupPoliciesByGroup",
Use: "group-policies-by-group [group-id]",
Use: "group-policies-by-group <group-id>",
Short: "Query for group policies by group id",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "group_id"},
@ -53,7 +53,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "GroupPoliciesByAdmin",
Use: "group-policies-by-admin [admin]",
Use: "group-policies-by-admin <admin>",
Short: "Query for group policies by admin account address",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "admin"},
@ -61,7 +61,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "Proposal",
Use: "proposal [proposal-id]",
Use: "proposal <proposal-id>",
Short: "Query for proposal by id",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "proposal_id"},
@ -69,7 +69,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "ProposalsByGroupPolicy",
Use: "proposals-by-group-policy [group-policy-account]",
Use: "proposals-by-group-policy <group-policy-account>",
Short: "Query for proposals by account address of group policy",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "address"},
@ -77,7 +77,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "VoteByProposalVoter",
Use: "vote [proposal-id] [voter]",
Use: "vote <proposal-id> <voter>",
Short: "Query for vote by proposal id and voter account address",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "proposal_id"},
@ -86,7 +86,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "VotesByProposal",
Use: "votes-by-proposal [proposal-id]",
Use: "votes-by-proposal <proposal-id>",
Short: "Query for votes by proposal id",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "proposal_id"},
@ -94,7 +94,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "VotesByVoter",
Use: "votes-by-voter [voter]",
Use: "votes-by-voter <voter>",
Short: "Query for votes by voter account address",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "voter"},
@ -102,7 +102,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "GroupsByMember",
Use: "groups-by-member [address]",
Use: "groups-by-member <address>",
Short: "Query for groups by member address",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "address"},
@ -110,7 +110,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "TallyResult",
Use: "tally-result [proposal-id]",
Use: "tally-result <proposal-id>",
Short: "Query tally result of proposal",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "proposal_id"},
@ -129,7 +129,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "UpdateGroupAdmin",
Use: "update-group-admin [admin] [group-id] [new-admin]",
Use: "update-group-admin <admin> <group-id> <new-admin>",
Short: "Update a group's admin",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "admin"}, {ProtoField: "group_id"}, {ProtoField: "new_admin"},
@ -137,7 +137,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "UpdateGroupMetadata",
Use: "update-group-metadata [admin] [group-id] [metadata]",
Use: "update-group-metadata <admin> <group-id> <metadata>",
Short: "Update a group's metadata",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "admin"}, {ProtoField: "group_id"}, {ProtoField: "metadata"},
@ -145,7 +145,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "UpdateGroupPolicyAdmin",
Use: "update-group-policy-admin [admin] [group-policy-account] [new-admin]",
Use: "update-group-policy-admin <admin> <group-policy-account> <new-admin>",
Short: "Update a group policy admin",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "admin"}, {ProtoField: "group_policy_address"}, {ProtoField: "new_admin"},
@ -153,7 +153,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "UpdateGroupPolicyMetadata",
Use: "update-group-policy-metadata [admin] [group-policy-account] [new-metadata]",
Use: "update-group-policy-metadata <admin> <group-policy-account> <new-metadata>",
Short: "Update a group policy metadata",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "admin"}, {ProtoField: "group_policy_address"}, {ProtoField: "metadata"},
@ -161,7 +161,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "WithdrawProposal",
Use: "withdraw-proposal [proposal-id] [group-policy-admin-or-proposer]",
Use: "withdraw-proposal <proposal-id> <group-policy-admin-or-proposer>",
Short: "Withdraw a submitted proposal",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "proposal_id"}, {ProtoField: "address"},
@ -169,7 +169,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "Vote",
Use: "vote [proposal-id] [voter] [vote-option] [metadata]",
Use: "vote <proposal-id> <voter> <vote-option> <metadata>",
Long: `Vote on a proposal.
Parameters:
proposal-id: unique ID of the proposal
@ -191,7 +191,7 @@ Parameters:
},
{
RpcMethod: "Exec",
Use: "exec [proposal-id]",
Use: "exec <proposal-id>",
Short: "Execute a proposal",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "proposal_id"},
@ -199,7 +199,7 @@ Parameters:
},
{
RpcMethod: "LeaveGroup",
Use: "leave-group [member-address] [group-id]",
Use: "leave-group <member-address> <group-id>",
Short: "Remove member from the group",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "address"}, {ProtoField: "group_id"},

View File

@ -36,7 +36,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "UpdateParams",
Use: "update-params-proposal [params]",
Use: "update-params-proposal <params>",
Short: "Submit a proposal to update mint module params. Note: the entire params must be provided.",
Long: fmt.Sprintf("Submit a proposal to update mint module params. Note: the entire params must be provided.\n See the fields to fill in by running `%s query mint params --output json`", version.AppName),
Example: fmt.Sprintf(`%s tx mint update-params-proposal '{ "mint_denom": "stake", ... }'`, version.AppName),

View File

@ -18,7 +18,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Balance",
Use: "balance [owner] [class-id]",
Use: "balance <owner> <class-id>",
Short: "Query the number of NFTs of a given class owned by the owner.",
Example: fmt.Sprintf(`%s query %s balance <owner> <class-id>`, version.AppName, nft.ModuleName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -28,7 +28,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "Owner",
Use: "owner [class-id] [nft-id]",
Use: "owner <class-id> <nft-id>",
Short: "Query the owner of the NFT based on its class and id.",
Example: fmt.Sprintf(`%s query %s owner <class-id> <nft-id>`, version.AppName, nft.ModuleName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -38,7 +38,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "Supply",
Use: "supply [class-id]",
Use: "supply <class-id>",
Short: "Query the number of nft based on the class.",
Example: fmt.Sprintf(`%s query %s supply <class-id>`, version.AppName, nft.ModuleName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -47,7 +47,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "NFTs",
Use: "nfts [class-id]",
Use: "nfts <class-id>",
Short: "Query all NFTs of a given class or owner address.",
Example: fmt.Sprintf(`%s query %s nfts <class-id> --owner=<owner>`, version.AppName, nft.ModuleName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -56,7 +56,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "NFT",
Use: "nft [class-id] [nft-id]",
Use: "nft <class-id> <nft-id>",
Short: "Query an NFT based on its class and id.",
Example: fmt.Sprintf(`%s query %s nft <class-id> <nft-id>`, version.AppName, nft.ModuleName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -66,7 +66,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "Class",
Use: "class [class-id]",
Use: "class <class-id>",
Short: "Query an NFT class based on its id",
Example: fmt.Sprintf(`%s query %s class <class-id>`, version.AppName, nft.ModuleName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -86,7 +86,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Send",
Use: "send [class-id] [nft-id] [receiver] --from [sender]",
Use: "send <class-id> <nft-id> <receiver> --from <sender>",
Short: "Transfer ownership of NFT",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "class_id"},

View File

@ -13,7 +13,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Params",
Use: "subspace [subspace] [key]",
Use: "subspace <subspace> <key>",
Short: "Query for raw parameters by subspace and key",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "subspace"},

View File

@ -20,7 +20,7 @@ import (
// a parameter change proposal governance transaction.
func NewSubmitParamChangeProposalTxCmd() *cobra.Command {
return &cobra.Command{
Use: "param-change [proposal-file]",
Use: "param-change <proposal-file>",
Args: cobra.ExactArgs(1),
Short: "Submit a parameter change proposal",
Long: strings.TrimSpace(

View File

@ -35,14 +35,14 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "FundCommunityPool",
Use: "fund-community-pool [amount]",
Use: "fund-community-pool <amount>",
Short: "Funds the community pool with the specified amount",
Example: fmt.Sprintf(`$ %s tx protocolpool fund-community-pool 100uatom --from mykey`, version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "amount"}},
},
{
RpcMethod: "SubmitBudgetProposal",
Use: "submit-budget-proposal [recipient] [budget-per-tranche] [start-time] [tranches] [period]",
Use: "submit-budget-proposal <recipient> <budget-per-tranche> <start-time> <tranches> <period>",
Short: "Submit a budget proposal",
Example: fmt.Sprintf(`$ %s tx protocolpool submit-budget-proposal cosmos1... 1000000uatom 2023-10-31T12:34:56.789Z 10 1000 --from mykey`, version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -55,14 +55,14 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "ClaimBudget",
Use: "claim-budget [recipient]",
Use: "claim-budget <recipient>",
Short: "Claim the distributed budget",
Example: fmt.Sprintf(`$ %s tx protocolpool claim-budget cosmos1... --from mykey`, version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "recipient_address"}},
},
{
RpcMethod: "CreateContinuousFund",
Use: "create-continuous-fund [recipient] [percentage] <expiry>",
Use: "create-continuous-fund <recipient> <percentage> <expiry>",
Short: "Create continuous fund for a recipient with optional expiry",
Example: fmt.Sprintf(`$ %s tx protocolpool create-continuous-fund cosmos1... 0.2 2023-11-31T12:34:56.789Z --from mykey`, version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -74,14 +74,14 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "WithdrawContinuousFund",
Use: "withdraw-continuous-fund [recipient]",
Use: "withdraw-continuous-fund <recipient>",
Short: "Withdraw continuous fund allocated to the recipient",
Example: fmt.Sprintf(`$ %s tx protocolpool withdraw-continuous-fund cosmos1... --from mykey`, version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "recipient_address"}},
},
{
RpcMethod: "CancelContinuousFund",
Use: "cancel-continuous-fund [recipient_address]",
Use: "cancel-continuous-fund <recipient_address>",
Short: "Cancel continuous fund for a specific recipient",
Example: fmt.Sprintf(`$ %s tx protocolpool cancel-continuous-fund cosmos1... --from mykey`, version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{

View File

@ -21,7 +21,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "SigningInfo",
Use: "signing-info [validator-conspub/address]",
Use: "signing-info <validator-conspub/address>",
Short: "Query a validator's signing information",
Long: "Query a validator's signing information, with a pubkey ('<appd> comet show-validator') or a validator consensus address",
Example: fmt.Sprintf(`%s query slashing signing-info '{"@type":"/cosmos.crypto.ed25519.PubKey","key":"OauFcTKbN5Lx3fJL689cikXBqe+hcp6Y+x0rYUdR9Jk="}'`, version.AppName),
@ -47,7 +47,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "UpdateParams",
Use: "update-params-proposal [params]",
Use: "update-params-proposal <params>",
Short: "Submit a proposal to update slashing module params. Note: the entire params must be provided.",
Long: fmt.Sprintf("Submit a proposal to update slashing module params. Note: the entire params must be provided.\n See the fields to fill in by running `%s query slashing params --output json`", version.AppName),
Example: fmt.Sprintf(`%s tx slashing update-params-proposal '{ "signed_blocks_window": "100", ... }'`, version.AppName),

View File

@ -22,7 +22,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "Validator",
Use: "validator [validator-addr]",
Use: "validator <validator-addr>",
Short: "Query a validator",
Long: "Query details about an individual validator.",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -31,7 +31,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "ValidatorDelegations",
Use: "delegations-to [validator-addr]",
Use: "delegations-to <validator-addr>",
Short: "Query all delegations made to one validator",
Long: "Query delegations on an individual validator.",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -42,7 +42,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "ValidatorUnbondingDelegations",
Use: "unbonding-delegations-from [validator-addr]",
Use: "unbonding-delegations-from <validator-addr>",
Short: "Query all unbonding delegatations from a validator",
Long: "Query delegations that are unbonding _from_ a validator.",
Example: fmt.Sprintf("$ %s query staking unbonding-delegations-from [val-addr]", version.AppName),
@ -52,7 +52,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "Delegation",
Use: "delegation [delegator-addr] [validator-addr]",
Use: "delegation <delegator-addr> <validator-addr>",
Short: "Query a delegation based on address and validator address",
Long: "Query delegations for an individual delegator on an individual validator",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -62,7 +62,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "UnbondingDelegation",
Use: "unbonding-delegation [delegator-addr] [validator-addr]",
Use: "unbonding-delegation <delegator-addr> <validator-addr>",
Short: "Query an unbonding-delegation record based on delegator and validator address",
Long: "Query unbonding delegations for an individual delegator on an individual validator.",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -72,7 +72,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "DelegatorDelegations",
Use: "delegations [delegator-addr]",
Use: "delegations <delegator-addr>",
Short: "Query all delegations made by one delegator",
Long: "Query delegations for an individual delegator on all validators.",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -81,7 +81,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "DelegatorValidators",
Use: "delegator-validators [delegator-addr]",
Use: "delegator-validators <delegator-addr>",
Short: "Query all validators info for given delegator address",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "delegator_addr"},
@ -89,7 +89,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "DelegatorValidator",
Use: "delegator-validator [delegator-addr] [validator-addr]",
Use: "delegator-validator <delegator-addr> <validator-addr>",
Short: "Query validator info for given delegator validator pair",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "delegator_addr"},
@ -98,7 +98,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "DelegatorUnbondingDelegations",
Use: "unbonding-delegations [delegator-addr]",
Use: "unbonding-delegations <delegator-addr>",
Short: "Query all unbonding-delegations records for one delegator",
Long: "Query unbonding delegations for an individual delegator.",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -107,7 +107,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "Redelegations",
Use: "redelegation [delegator-addr] [src-validator-addr] [dst-validator-addr]",
Use: "redelegation <delegator-addr> <src-validator-addr> <dst-validator-addr>",
Short: "Query a redelegation record based on delegator and a source and destination validator address",
Long: "Query a redelegation record for an individual delegator between a source and destination validator.",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -118,7 +118,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "HistoricalInfo",
Use: "historical-info [height]",
Use: "historical-info <height>",
Short: "Query historical info at given height",
Example: fmt.Sprintf("$ %s query staking historical-info 5", version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
@ -144,7 +144,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Delegate",
Use: "delegate [validator-addr] [amount] --from [delegator_address]",
Use: "delegate <validator-addr> <amount> --from <delegator_address>",
Short: "Delegate liquid tokens to a validator",
Long: "Delegate an amount of liquid coins to a validator from your wallet.",
Example: fmt.Sprintf("%s tx staking delegate cosmosvaloper... 1000stake --from mykey", version.AppName),
@ -152,7 +152,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "BeginRedelegate",
Use: "redelegate [src-validator-addr] [dst-validator-addr] [amount] --from [delegator]",
Use: "redelegate <src-validator-addr> <dst-validator-addr> <amount> --from <delegator>",
Short: "Generate multisig signatures for transactions generated offline",
Long: "Redelegate an amount of illiquid staking tokens from one validator to another.",
Example: fmt.Sprintf(`%s tx staking redelegate cosmosvaloper... cosmosvaloper... 100stake --from mykey`, version.AppName),
@ -160,7 +160,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "Undelegate",
Use: "unbond [validator-addr] [amount] --from [delegator_address]",
Use: "unbond <validator-addr> <amount> --from <delegator_address>",
Short: "Unbond shares from a validator",
Long: "Unbond an amount of bonded shares from a validator.",
Example: fmt.Sprintf(`%s tx staking unbond cosmosvaloper... 100stake --from mykey`, version.AppName),
@ -168,21 +168,21 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "CancelUnbondingDelegation",
Use: "cancel-unbond [validator-addr] [amount] [creation-height]",
Use: "cancel-unbond <validator-addr> <amount> <creation-height>",
Short: "Cancel unbonding delegation and delegate back to the validator",
Example: fmt.Sprintf(`%s tx staking cancel-unbond cosmosvaloper... 100stake 2 --from mykey`, version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "validator_address"}, {ProtoField: "amount"}, {ProtoField: "creation_height"}},
},
{
RpcMethod: "RotateConsPubKey",
Use: "rotate-cons-pubkey [validator-address] [new-pubkey]",
Use: "rotate-cons-pubkey <validator-address> <new-pubkey>",
Short: fmt.Sprintf("rotate validator consensus pub key. Note: you have to replace the `~/.%sd/config/priv_validator_key.json` with new key and restart the node after rotating the key", version.AppName),
Example: fmt.Sprintf(`%s tx staking rotate-cons-pubkey myvalidator {"@type":"/cosmos.crypto.ed25519.PubKey","key":"oWg2ISpLF405Jcm2vXV+2v4fnjodh6aafuIdeoW+rUw="}`, version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "validator_address"}, {ProtoField: "new_pubkey"}},
},
{
RpcMethod: "UpdateParams",
Use: "update-params-proposal [params]",
Use: "update-params-proposal <params>",
Short: "Submit a proposal to update staking module params. Note: the entire params must be provided.",
Long: fmt.Sprintf("Submit a proposal to update staking module params. Note: the entire params must be provided.\n See the fields to fill in by running `%s query staking params --output json`", version.AppName),
Example: fmt.Sprintf(`%s tx staking update-params-proposal '{ "unbonding_time": "504h0m0s", ... }'`, version.AppName),

View File

@ -54,7 +54,7 @@ func NewTxCmd() *cobra.Command {
// TODO(@julienrbrt): remove this once AutoCLI can flatten nested structs.
func NewCreateValidatorCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "create-validator [path/to/validator.json]",
Use: "create-validator <path/to/validator.json>",
Short: "Create new validator initialized with a self-delegation to it",
Args: cobra.ExactArgs(1),
Long: `Create a new validator initialized with a self-delegation by submitting a JSON file with the new validator details.`,

View File

@ -18,7 +18,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
{
RpcMethod: "AppliedPlan",
Use: "applied [upgrade-name]",
Use: "applied <upgrade-name>",
Short: "Query the block header for height at which a completed upgrade was applied",
Long: "If upgrade-name was previously executed on the chain, this returns the header for the block at which it was applied. This helps a client determine which binary was valid over a given range of blocks, as well as more context to understand past migrations.",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{

View File

@ -45,7 +45,7 @@ func GetTxCmd() *cobra.Command {
// This commands is not migrated to autocli as it contains extra validation that is useful for submitting upgrade proposals.
func NewCmdSubmitUpgradeProposal() *cobra.Command {
cmd := &cobra.Command{
Use: "software-upgrade [name] (--upgrade-height [height]) (--upgrade-info [info]) [flags]",
Use: "software-upgrade <name> [--upgrade-height <height>] [--upgrade-info <info>] [flags]",
Args: cobra.ExactArgs(1),
Short: "Submit a software upgrade proposal",
Long: "Submit a software upgrade along with an initial deposit.\n" +