[#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

@ -27,7 +27,6 @@ var accountingCmd = &cobra.Command{
_ = viper.BindPFlag(walletPath, flags.Lookup(walletPath))
_ = viper.BindPFlag(address, flags.Lookup(address))
_ = viper.BindPFlag(rpc, flags.Lookup(rpc))
_ = viper.BindPFlag(verbose, flags.Lookup(verbose))
},
}
@ -67,7 +66,6 @@ func initAccountingBalanceCmd() {
ff.StringP(walletPath, walletPathShorthand, walletPathDefault, walletPathUsage)
ff.StringP(address, addressShorthand, addressDefault, addressUsage)
ff.StringP(rpc, rpcShorthand, rpcDefault, rpcUsage)
ff.BoolP(verbose, verboseShorthand, verboseDefault, verboseUsage)
accountingBalanceCmd.Flags().StringVar(&balanceOwner, "owner", "", "owner of balance account (omit to use owner from private key)")
}