[#1120] cli: Fix printing config file in verbose mode

It was broken since `initConfig` was made before every execution of the
command and flags have not been read by cobra yet, so it was impossible to
print config file path if `verbose` flag was set in command line not in
config file.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-01-28 21:03:44 +03:00 committed by Alex Vanin
parent 08e83a2bc7
commit 679c922e0c
4 changed files with 3 additions and 8 deletions

View file

@ -35,7 +35,6 @@ var (
_ = viper.BindPFlag(generateKey, flags.Lookup(generateKey))
_ = viper.BindPFlag(walletPath, flags.Lookup(walletPath))
_ = viper.BindPFlag(address, flags.Lookup(address))
_ = viper.BindPFlag(verbose, flags.Lookup(verbose))
},
}
@ -194,7 +193,6 @@ func initCommonFlagsWithoutRPC(cmd *cobra.Command) {
flags.BoolP(generateKey, generateKeyShorthand, generateKeyDefault, generateKeyUsage)
flags.StringP(walletPath, walletPathShorthand, walletPathDefault, walletPathUsage)
flags.StringP(address, addressShorthand, addressDefault, addressUsage)
flags.BoolP(verbose, verboseShorthand, verboseDefault, verboseUsage)
}
func initUtilSignBearerCmd() {