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

This commit is contained in:
Lucas Francisco López
2024-08-21 08:36:34 +00:00
committed by GitHub
parent 95dcf845c3
commit bdb9232ed8
56 changed files with 200 additions and 173 deletions
+1 -1
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
+1 -1
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) {
+1 -1
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.
+1 -1
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:
+2 -2
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(
+2 -2
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.
+1 -1
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:
+1 -1
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.