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 | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cmd/neofs-cli/modules/container.go b/cmd/neofs-cli/modules/container.go index ca28679dc..404acdb50 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 43f070ff7..e66ff4032 100644 --- a/go.sum +++ b/go.sum @@ -270,8 +270,6 @@ github.com/nspcc-dev/neo-go v0.73.1-pre.0.20200303142215-f5a1b928ce09/go.mod h1: github.com/nspcc-dev/neo-go v0.91.0/go.mod h1:G6HdOWvzQ6tlvFdvFSN/PgCzLPN/X/X4d5hTjFRUDcc= github.com/nspcc-dev/neo-go v0.91.1-pre.0.20200827184617-7560aa345a78 h1:stIa+nBXK8uDY/JZaxIZzAUfkzfaotVw2FbnHxO4aZI= github.com/nspcc-dev/neo-go v0.91.1-pre.0.20200827184617-7560aa345a78/go.mod h1:G6HdOWvzQ6tlvFdvFSN/PgCzLPN/X/X4d5hTjFRUDcc= -github.com/nspcc-dev/neofs-api-go v1.3.1-0.20201014180956-7b3736567c0b h1:P/riND6RkFU6xv895sdTBYqjtRh7jDSvKC1+tzP3LcQ= -github.com/nspcc-dev/neofs-api-go v1.3.1-0.20201014180956-7b3736567c0b/go.mod h1:FsFd1z4YzoEgPlltsUgnqna9qhcF87RHYjot0pby2L4= github.com/nspcc-dev/neofs-api-go v1.3.1-0.20201015080537-4e6350f6d438 h1:Rw3h9BnYzGiDtZX7YPb/7NCFtykE+PqTX7mRL9pqNv0= github.com/nspcc-dev/neofs-api-go v1.3.1-0.20201015080537-4e6350f6d438/go.mod h1:FsFd1z4YzoEgPlltsUgnqna9qhcF87RHYjot0pby2L4= github.com/nspcc-dev/neofs-crypto v0.2.0/go.mod h1:F/96fUzPM3wR+UGsPi3faVNmFlA9KAEAUQR7dMxZmNA=