[#25] Use comma separated container attributes in CLI

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
remotes/KirillovDenis/release/v0.21.1
Alex Vanin 2020-10-16 12:29:57 +03:00 committed by Alex Vanin
parent feac279ced
commit b7dfc73bbc
2 changed files with 4 additions and 6 deletions

View File

@ -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())

2
go.sum
View File

@ -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=