From b7dfc73bbc9dade5104893b347e70b75b200d57f Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 16 Oct 2020 12:29:57 +0300 Subject: [PATCH] [#25] Use comma separated container attributes in CLI Signed-off-by: Alex Vanin --- cmd/neofs-cli/modules/container.go | 8 ++++---- go.sum | Bin 58865 -> 58620 bytes 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/neofs-cli/modules/container.go b/cmd/neofs-cli/modules/container.go index ca28679d..404acdb5 100644 --- a/cmd/neofs-cli/modules/container.go +++ b/cmd/neofs-cli/modules/container.go @@ -25,7 +25,7 @@ import ( ) const ( - attributeDelimiter = ":" + attributeDelimiter = "=" awaitTimeout = 120 // in seconds ) @@ -333,8 +333,8 @@ func init() { "hex encoded basic ACL value or keywords 'public', 'private', 'readonly'") createContainerCmd.Flags().StringVarP(&containerPolicy, "policy", "p", "", "QL-encoded or JSON-encoded placement policy or path to file with it") - createContainerCmd.Flags().StringArrayVarP(&containerAttributes, "attribute", "a", nil, - "colon separated pair of container attribute key and value, e.g. `target:cats`") + createContainerCmd.Flags().StringSliceVarP(&containerAttributes, "attributes", "a", nil, + "comma separated pairs of container attributes in form of Key1=Value1,Key2=Value2") createContainerCmd.Flags().StringVarP(&containerNonce, "nonce", "n", "", "UUIDv4 nonce value for container") createContainerCmd.Flags().BoolVar(&containerAwait, "await", false, "block execution until container is persisted") @@ -479,7 +479,7 @@ func prettyPrintContainer(cnr *container.Container) { } for _, attribute := range cnr.GetAttributes() { - fmt.Printf("attribute: `%s:%s`\n", attribute.GetKey(), attribute.GetValue()) + fmt.Printf("attribute: %s=%s\n", attribute.GetKey(), attribute.GetValue()) } nonce, err := uuid.FromBytes(cnr.GetNonce()) diff --git a/go.sum b/go.sum index 43f070ff783f860ab86d70f60a1295dffc57b9bc..e66ff403272aee6e0a03ced36ec20eb474392170 100644 GIT binary patch delta 18 acmex(n)%O3<_(Y1C;MfJY<``=Rto@PatUYv delta 115 zcmex!lKJCl<_(Y1olOia3@lB}bj_2D&5g}W&CHVxk`yuwtpfCmGW}f4g0kI0%__<) zEKQ43LYyKCvr2+8%(GmA%e