From abe180b13297ee53409fa62394d9405d09c85a79 Mon Sep 17 00:00:00 2001 From: zhangkai Date: Tue, 20 Jun 2023 08:17:19 +0800 Subject: [PATCH] add leaked bind --- cmd/okbchaind/iaviewer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/okbchaind/iaviewer.go b/cmd/okbchaind/iaviewer.go index a94f33b7f..1c7dc087b 100644 --- a/cmd/okbchaind/iaviewer.go +++ b/cmd/okbchaind/iaviewer.go @@ -235,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 } @@ -321,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 }