[#1959] neofs-adm: Allow to test all commands with a local dump

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-10-24 14:36:24 +03:00 committed by fyrchik
parent 8648b102db
commit 02bea52f40
3 changed files with 26 additions and 6 deletions

View file

@ -126,13 +126,10 @@ func newInitializeContext(cmd *cobra.Command, v *viper.Viper) (*initializeContex
var c Client
if v.GetString(localDumpFlag) != "" {
if cmd.Name() != "init" {
return nil, errors.New("dump creation is only supported for `init` command")
}
if v.GetString(endpointFlag) != "" {
return nil, fmt.Errorf("`%s` and `%s` flags are mutually exclusive", endpointFlag, localDumpFlag)
}
c, err = newLocalClient(v, wallets)
c, err = newLocalClient(cmd, v, wallets)
} else {
c, err = getN3Client(v)
}