added used of cobra arg constraints

This commit is contained in:
rigelrozanski
2018-04-26 17:32:20 -04:00
parent 2021ee1c77
commit 54a5869efd
7 changed files with 17 additions and 42 deletions
+1
View File
@@ -20,6 +20,7 @@ func blockCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "block [height]",
Short: "Get verified data for a the block at given height",
Args: cobra.MaximumNArgs(1),
RunE: printBlock,
}
cmd.Flags().StringP(client.FlagNode, "n", "tcp://localhost:46657", "Node to connect to")
+2 -1
View File
@@ -16,8 +16,9 @@ import (
func validatorCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "validatorset <height>",
Use: "validatorset [height]",
Short: "Get the full validator set at given height",
Args: cobra.MaximumNArgs(1),
RunE: printValidators,
}
cmd.Flags().StringP(client.FlagNode, "n", "tcp://localhost:46657", "Node to connect to")