summaryrefslogtreecommitdiff
path: root/Command/Move.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Move.hs')
-rw-r--r--Command/Move.hs15
1 files changed, 8 insertions, 7 deletions
diff --git a/Command/Move.hs b/Command/Move.hs
index 7d11b5abd..b79e4c929 100644
--- a/Command/Move.hs
+++ b/Command/Move.hs
@@ -26,13 +26,14 @@ def = [withOptions moveOptions $ command "move" paramPaths seek
moveOptions :: [Option]
moveOptions = fromToOptions ++ keyOptions
-seek :: [CommandSeek]
-seek =
- [ withField toOption Remote.byNameWithUUID $ \to ->
- withField fromOption Remote.byNameWithUUID $ \from ->
- withKeyOptions (startKey to from True) $
- withFilesInGit $ whenAnnexed $ start to from True
- ]
+seek :: CommandSeek
+seek ps = do
+ to <- getOptionField toOption Remote.byNameWithUUID
+ from <- getOptionField fromOption Remote.byNameWithUUID
+ withKeyOptions
+ (startKey to from True)
+ (withFilesInGit $ whenAnnexed $ start to from True)
+ ps
start :: Maybe Remote -> Maybe Remote -> Bool -> FilePath -> (Key, Backend) -> CommandStart
start to from move file (key, _) = start' to from move (Just file) key