1
0
mirror of https://github.com/minio/mc.git synced 2025-11-10 13:42:32 +03:00

cp: Add object lock related flags (#3127)

- Adds --retention-mode,--retention-duration &
  --legal-hold flags in cp command

- Adds --bypass flag in rm command
This commit is contained in:
Nitish Tiwari
2020-04-08 08:21:20 +05:30
committed by GitHub
parent 8cae137525
commit 18f81e5458
13 changed files with 232 additions and 101 deletions

View File

@@ -55,6 +55,14 @@ func checkCopySyntax(ctx *cli.Context, encKeyDB map[string][]prefixSSEPair) {
}
}
if ctx.String(rdFlag) != "" && ctx.String(rmFlag) == "" {
fatalIf(errInvalidArgument().Trace(), fmt.Sprintf("Both object retention flags `--%s` and `--%s` are required.\n", rdFlag, rmFlag))
}
if ctx.String(rdFlag) == "" && ctx.String(rmFlag) != "" {
fatalIf(errInvalidArgument().Trace(), fmt.Sprintf("Both object retention flags `--%s` and `--%s` are required.\n", rdFlag, rmFlag))
}
// Guess CopyURLsType based on source and target URLs.
copyURLsType, err := guessCopyURLType(srcURLs, tgtURL, isRecursive, encKeyDB)
if err != nil {