forked from TrueCloudLab/frostfs-node
[#1612] neofs-cli: Unify expiration flags
Use `expire-at` everywhere expiration epoch is expected. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
175e9da3a7
commit
a52e7c2c99
7 changed files with 33 additions and 30 deletions
|
@ -22,7 +22,6 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
putExpiresOnFlag = "expires-on"
|
||||
noProgressFlag = "no-progress"
|
||||
notificationFlag = "notify"
|
||||
)
|
||||
|
@ -52,7 +51,7 @@ func initObjectPutCmd() {
|
|||
flags.String("attributes", "", "User attributes in form of Key1=Value1,Key2=Value2")
|
||||
flags.Bool("disable-filename", false, "Do not set well-known filename attribute")
|
||||
flags.Bool("disable-timestamp", false, "Do not set well-known timestamp attribute")
|
||||
flags.Uint64VarP(&putExpiredOn, putExpiresOnFlag, "e", 0, "Last epoch in the life of the object")
|
||||
flags.Uint64VarP(&putExpiredOn, commonflags.ExpireAt, "e", 0, "Last epoch in the life of the object")
|
||||
flags.Bool(noProgressFlag, false, "Do not show progress bar")
|
||||
|
||||
flags.String(notificationFlag, "", "Object notification in the form of *epoch*:*topic*; '-' topic means using default")
|
||||
|
@ -76,7 +75,7 @@ func putObject(cmd *cobra.Command, _ []string) {
|
|||
attrs, err := parseObjectAttrs(cmd)
|
||||
common.ExitOnErr(cmd, "can't parse object attributes: %w", err)
|
||||
|
||||
expiresOn, _ := cmd.Flags().GetUint64(putExpiresOnFlag)
|
||||
expiresOn, _ := cmd.Flags().GetUint64(commonflags.ExpireAt)
|
||||
if expiresOn > 0 {
|
||||
var expAttrFound bool
|
||||
expAttrValue := strconv.FormatUint(expiresOn, 10)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue