Skip to content

Commit

Permalink
fix iaviewer flags not valid (#3123)
Browse files Browse the repository at this point in the history
* fix paramters not valid

* add more viper bind

---------

Co-authored-by: KamiD <[email protected]>
  • Loading branch information
giskook and KamiD authored Jun 19, 2023
1 parent 2dbe331 commit 0046c91
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/exchaind/iaviewer.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ func iaviewerReadCmd(ctx *iaviewerContext) *cobra.Command {
cmd.PersistentFlags().String(flagKey, "", "print only the value for this key, key must be in hex format.\n"+
"if specified, keyprefix, start and limit flags would be ignored")
cmd.PersistentFlags().String(flagKeyPrefix, "", "print values for keys with specified prefix, prefix must be in hex format.")
viper.BindPFlag(flagKeyPrefix, cmd.PersistentFlags().Lookup(flagKeyPrefix))
viper.BindPFlag(flagHex, cmd.PersistentFlags().Lookup(flagHex))
viper.BindPFlag(flagKey, cmd.PersistentFlags().Lookup(flagKey))

return cmd
}

Expand All @@ -232,6 +236,7 @@ func iaviewerReadNodeCmd(ctx *iaviewerContext) *cobra.Command {
},
}
cmd.PersistentFlags().String(flagNodeHash, "", "print only the value for this hash, key must be in hex format.")
viper.BindPFlag(flagNodeHash, cmd.PersistentFlags().Lookup(flagNodeHash))
return cmd
}

Expand Down Expand Up @@ -318,6 +323,8 @@ func iaviewerDiffCmd(ctx *iaviewerContext) *cobra.Command {
}
cmd.PersistentFlags().Bool(flagHex, false, "print key and value in hex format")
cmd.PersistentFlags().String(flagKeyPrefix, "", "diff values for keys with specified prefix, prefix must be in hex format.")
viper.BindPFlag(flagHex, cmd.PersistentFlags().Lookup(flagHex))
viper.BindPFlag(flagKeyPrefix, cmd.PersistentFlags().Lookup(flagKeyPrefix))
return cmd
}

Expand Down

0 comments on commit 0046c91

Please sign in to comment.