-
Notifications
You must be signed in to change notification settings - Fork 4.2k
R4R: CLI flags to args #3503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
R4R: CLI flags to args #3503
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ package cli | |
| import ( | ||
| "io/ioutil" | ||
| "os" | ||
| "strings" | ||
|
|
||
| "github.com/spf13/cobra" | ||
| amino "github.com/tendermint/go-amino" | ||
|
|
@@ -15,11 +16,14 @@ import ( | |
| // GetSignCommand returns the sign command | ||
| func GetBroadcastCommand(codec *amino.Codec) *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "broadcast <file>", | ||
| Use: "broadcast [file_path]", | ||
| Short: "Broadcast transactions generated offline", | ||
| Long: `Broadcast transactions created with the --generate-only flag and signed with the sign command. | ||
| Read a transaction from <file> and broadcast it to a node. If you supply a dash (-) argument | ||
| in place of an input filename, the command reads from standard input.`, | ||
| Long: strings.TrimSpace(`Broadcast transactions created with the --generate-only flag and signed with the sign command. | ||
| Read a transaction from [file_path] and broadcast it to a node. If you supply a dash (-) argument | ||
| in place of an input filename, the command reads from standard input. | ||
|
|
||
| $ gaiacli tx broadcast ./mytxn.json | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prepend with |
||
| `), | ||
| Args: cobra.ExactArgs(1), | ||
| RunE: func(cmd *cobra.Command, args []string) (err error) { | ||
| cliCtx := context.NewCLIContext().WithCodec(codec) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ package cli | |
| import ( | ||
| "fmt" | ||
| "strconv" | ||
| "strings" | ||
|
|
||
| "github.com/spf13/cobra" | ||
|
|
||
|
|
@@ -59,6 +60,10 @@ func GetCmdQueryValidatorCommission(queryRoute string, cdc *codec.Codec) *cobra. | |
| Use: "commission [validator]", | ||
| Args: cobra.ExactArgs(1), | ||
| Short: "Query distribution validator commission", | ||
| Long: strings.TrimSpace(`Query validator commission rewards from delegators to that validator: | ||
|
|
||
| $ gaiacli query distr commission cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
| `), | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| cliCtx := context.NewCLIContext().WithCodec(cdc) | ||
|
|
||
|
|
@@ -85,6 +90,10 @@ func GetCmdQueryValidatorSlashes(queryRoute string, cdc *codec.Codec) *cobra.Com | |
| Use: "slashes [validator] [start-height] [end-height]", | ||
| Args: cobra.ExactArgs(3), | ||
| Short: "Query distribution validator slashes", | ||
| Long: strings.TrimSpace(`Query all slashes of a validator for a given block range: | ||
|
|
||
| $ gaiacli query distr slashes cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 0 100 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
| `), | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| cliCtx := context.NewCLIContext().WithCodec(cdc) | ||
|
|
||
|
|
@@ -124,9 +133,14 @@ func GetCmdQueryValidatorSlashes(queryRoute string, cdc *codec.Codec) *cobra.Com | |
| // GetCmdQueryDelegatorRewards implements the query delegator rewards command. | ||
| func GetCmdQueryDelegatorRewards(queryRoute string, cdc *codec.Codec) *cobra.Command { | ||
| return &cobra.Command{ | ||
| Use: "rewards [delegator] [validator]", | ||
| Use: "rewards [delegator-addr] [<validator-addr>]", | ||
| Args: cobra.RangeArgs(1, 2), | ||
| Short: "Query all distribution delegator rewards or rewards from a particular validator", | ||
| Long: strings.TrimSpace(`Query all rewards earned by a delegator, optionally restrict to rewards from a single validator: | ||
|
|
||
| $ gaiacli query distr rewards cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
| $ gaiacli query distr rewards cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj | ||
| `), | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| cliCtx := context.NewCLIContext().WithCodec(cdc) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.