--batch-keys

New --batch-keys option added to these commands:  get, drop, move, copy, whereis

git-annex-matching-options had to be reworded since some of its options
can be used to match on keys, not only files.

Sponsored-by: Luke Shumaker on Patreon
This commit is contained in:
Joey Hess 2021-08-25 14:20:33 -04:00
parent c64e80b357
commit ab7b5a492c
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
33 changed files with 244 additions and 133 deletions

View file

@ -33,7 +33,7 @@ optParser desc = CopyOptions
<*> parseFromToHereOptions
<*> optional (parseKeyOptions <|> parseFailedTransfersOption)
<*> parseAutoOption
<*> parseBatchOption
<*> parseBatchOption True
instance DeferredParseClass CopyOptions where
finishParse v = CopyOptions
@ -48,10 +48,10 @@ seek o = startConcurrency commandStages $ do
case batchOption o of
NoBatch -> withKeyOptions
(keyOptions o) (autoMode o) seeker
(commandAction . Command.Move.startKey (fromToOptions o) Command.Move.RemoveNever)
(commandAction . keyaction)
(withFilesInGitAnnex ww seeker)
=<< workTreeItems ww (copyFiles o)
Batch fmt -> batchAnnexedFilesMatching fmt seeker
Batch fmt -> batchAnnexed fmt seeker keyaction
where
ww = WarnUnmatchLsFiles
@ -63,6 +63,7 @@ seek o = startConcurrency commandStages $ do
Left ToHere -> Just False
, usesLocationLog = True
}
keyaction = Command.Move.startKey (fromToOptions o) Command.Move.RemoveNever
{- A copy is just a move that does not delete the source file.
- However, auto mode avoids unnecessary copies, and avoids getting or