From 802cecdf36f2575b62c42b105019ea70f3e8aef8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 15 Aug 2017 12:39:10 -0400 Subject: move, copy: Support --batch. --- Command/Copy.hs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'Command/Copy.hs') diff --git a/Command/Copy.hs b/Command/Copy.hs index 667f940f0..f071bf2dd 100644 --- a/Command/Copy.hs +++ b/Command/Copy.hs @@ -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 -- cgit v1.2.3