move, copy: Support --batch.
This commit is contained in:
parent
8526cd7c92
commit
2eb6309d3e
6 changed files with 49 additions and 10 deletions
|
@ -35,11 +35,15 @@ instance DeferredParseClass CopyOptions where
|
|||
<*> pure (autoMode v)
|
||||
|
||||
seek :: CopyOptions -> CommandSeek
|
||||
seek o = allowConcurrentOutput $
|
||||
withKeyOptions (Command.Move.keyOptions $ moveOptions o) (autoMode o)
|
||||
(Command.Move.startKey (moveOptions o) False)
|
||||
(withFilesInGit $ whenAnnexed $ start o)
|
||||
(Command.Move.moveFiles $ moveOptions o)
|
||||
seek o = allowConcurrentOutput $ do
|
||||
let go = whenAnnexed $ start o
|
||||
case Command.Move.batchOption (moveOptions o) of
|
||||
Batch -> batchInput Right (batchCommandAction . go)
|
||||
NoBatch -> withKeyOptions
|
||||
(Command.Move.keyOptions $ moveOptions o) (autoMode o)
|
||||
(Command.Move.startKey (moveOptions o) False)
|
||||
(withFilesInGit go)
|
||||
(Command.Move.moveFiles $ moveOptions o)
|
||||
|
||||
{- A copy is just a move that does not delete the source file.
|
||||
- However, auto mode avoids unnecessary copies, and avoids getting or
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue