Skip to content
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

fix iaviewer prefix #147

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmd/okbchaind/iaviewer.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,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 @@ -231,6 +235,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 @@ -317,6 +322,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