forked from TrueCloudLab/frostfs-node
[#1083] neofs-cli: use single flag for key and wallet
Currently have static priority of what key is used irregardless of whether a flag was provided via CLI or in config. This makes it impossible to override some of the config settings. While we could try to check if the key is provided by CLI by binding CLI flag under to viper under a different name the same problem would occur for config/environment variables. Fixing all of this with current set of keys is too complicate. In this commit we revert changes from #610 and use a single flag for all types of keys. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
ac82899e85
commit
759421ebbf
5 changed files with 145 additions and 41 deletions
|
@ -23,9 +23,7 @@ var accountingCmd = &cobra.Command{
|
|||
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
||||
flags := cmd.Flags()
|
||||
|
||||
_ = viper.BindPFlag(binaryKey, flags.Lookup(binaryKey))
|
||||
_ = viper.BindPFlag(walletPath, flags.Lookup(walletPath))
|
||||
_ = viper.BindPFlag(wif, flags.Lookup(wif))
|
||||
_ = viper.BindPFlag(address, flags.Lookup(address))
|
||||
_ = viper.BindPFlag(rpc, flags.Lookup(rpc))
|
||||
_ = viper.BindPFlag(verbose, flags.Lookup(verbose))
|
||||
|
@ -68,9 +66,7 @@ var accountingBalanceCmd = &cobra.Command{
|
|||
func initAccountingBalanceCmd() {
|
||||
ff := accountingBalanceCmd.Flags()
|
||||
|
||||
ff.StringP(binaryKey, binaryKeyShorthand, binaryKeyDefault, binaryKeyUsage)
|
||||
ff.StringP(walletPath, walletPathShorthand, walletPathDefault, walletPathUsage)
|
||||
ff.StringP(wif, wifShorthand, wifDefault, wifUsage)
|
||||
ff.StringP(address, addressShorthand, addressDefault, addressUsage)
|
||||
ff.StringP(rpc, rpcShorthand, rpcDefault, rpcUsage)
|
||||
ff.BoolP(verbose, verboseShorthand, verboseDefault, verboseUsage)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue