summaryrefslogtreecommitdiff
path: root/Command/Fsck.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Fsck.hs')
-rw-r--r--Command/Fsck.hs21
1 files changed, 11 insertions, 10 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 2ab47b562..8b320f209 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -70,16 +70,17 @@ fsckOptions =
, incrementalScheduleOption
] ++ keyOptions
-seek :: [CommandSeek]
-seek =
- [ withField fromOption Remote.byNameWithUUID $ \from ->
- withIncremental $ \i ->
- withKeyOptions (startKey i) $
- withFilesInGit $ whenAnnexed $ start from i
- ]
-
-withIncremental :: (Incremental -> CommandSeek) -> CommandSeek
-withIncremental = withValue $ do
+seek :: CommandSeek
+seek ps = do
+ from <- getOptionField fromOption Remote.byNameWithUUID
+ i <- getIncremental
+ withKeyOptions
+ (startKey i)
+ (withFilesInGit $ whenAnnexed $ start from i)
+ ps
+
+getIncremental :: Annex Incremental
+getIncremental = do
i <- maybe (return False) (checkschedule . parseDuration)
=<< Annex.getField (Option.name incrementalScheduleOption)
starti <- Annex.getFlag (Option.name startIncrementalOption)