From 79130f781e276bcf04e21ff1db4bba2c5cefbcaa Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Tue, 29 Nov 2022 13:22:17 +0300 Subject: [PATCH] [#2089] neofs-cli: Remove `-g` option from `neofs-cli control ...` and `neofs-cli container create` commands Signed-off-by: Anton Nikiforov --- CHANGELOG.md | 2 ++ cmd/neofs-cli/modules/container/create.go | 10 +++++++--- cmd/neofs-cli/modules/control/util.go | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c64c930d..3c5258fdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,8 @@ Changelog for NeoFS Node - ObjectID signature output in the CLI (#2104) ### Removed +- `-g` option from `neofs-cli control ...` and `neofs-cli container create` commands + ### Updated ### Updating from v0.34.0 Pass CID and OID parameters via the `--cid` and `--oid` flags, not as the command arguments. diff --git a/cmd/neofs-cli/modules/container/create.go b/cmd/neofs-cli/modules/container/create.go index 5b25b38fb..f4c91bc5a 100644 --- a/cmd/neofs-cli/modules/container/create.go +++ b/cmd/neofs-cli/modules/container/create.go @@ -39,7 +39,7 @@ It will be stored in sidechain when inner ring will accepts it.`, placementPolicy, err := parseContainerPolicy(containerPolicy) common.ExitOnErr(cmd, "", err) - key := key.GetOrGenerate(cmd) + key := key.Get(cmd) cli := internalclient.GetSDKClientByFlag(cmd, key, commonflags.RPC) if !force { @@ -133,10 +133,14 @@ It will be stored in sidechain when inner ring will accepts it.`, } func initContainerCreateCmd() { - commonflags.Init(createContainerCmd) - flags := createContainerCmd.Flags() + // Init common flags + flags.StringP(commonflags.RPC, commonflags.RPCShorthand, commonflags.RPCDefault, commonflags.RPCUsage) + flags.DurationP(commonflags.Timeout, commonflags.TimeoutShorthand, commonflags.TimeoutDefault, commonflags.TimeoutUsage) + flags.StringP(commonflags.WalletPath, commonflags.WalletPathShorthand, commonflags.WalletPathDefault, commonflags.WalletPathUsage) + flags.StringP(commonflags.Account, commonflags.AccountShorthand, commonflags.AccountDefault, commonflags.AccountUsage) + flags.StringVar(&containerACL, "basic-acl", acl.NamePrivate, fmt.Sprintf("HEX encoded basic ACL value or keywords like '%s', '%s', '%s'", acl.NamePublicRW, acl.NamePrivate, acl.NamePublicROExtended, )) diff --git a/cmd/neofs-cli/modules/control/util.go b/cmd/neofs-cli/modules/control/util.go index 04459c3f6..59bae90e6 100644 --- a/cmd/neofs-cli/modules/control/util.go +++ b/cmd/neofs-cli/modules/control/util.go @@ -15,9 +15,9 @@ import ( ) func initControlFlags(cmd *cobra.Command) { - commonflags.InitWithoutRPC(cmd) - ff := cmd.Flags() + ff.StringP(commonflags.WalletPath, commonflags.WalletPathShorthand, commonflags.WalletPathDefault, commonflags.WalletPathUsage) + ff.StringP(commonflags.Account, commonflags.AccountShorthand, commonflags.AccountDefault, commonflags.AccountUsage) ff.String(controlRPC, controlRPCDefault, controlRPCUsage) ff.DurationP(commonflags.Timeout, commonflags.TimeoutShorthand, commonflags.TimeoutDefault, commonflags.TimeoutUsage) }