From e8dd341a562e3ef7926f5f51009f4b71bdc4dad9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 20 Feb 2014 15:56:45 -0400 Subject: fsck: Refuse to do anything if more than one of --incremental, --more, and --incremental-schedule are given, since it's not clear which option should win. --- Command/Fsck.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Command') diff --git a/Command/Fsck.hs b/Command/Fsck.hs index d21f2191d..766154a4a 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -67,6 +67,7 @@ seek :: CommandSeek seek ps = do from <- getOptionField fsckFromOption Remote.byNameWithUUID i <- getIncremental + liftIO $ print i withKeyOptions (\k -> startKey i k =<< getNumCopies) (withFilesInGit $ whenAnnexed $ start from i) @@ -80,11 +81,12 @@ getIncremental = do morei <- Annex.getFlag (optionName moreIncrementalOption) case (i, starti, morei) of (False, False, False) -> return NonIncremental - (False, True, _) -> startIncremental + (False, True, False) -> startIncremental (False ,False, True) -> ContIncremental <$> getStartTime - (True, _, _) -> + (True, False, False) -> maybe startIncremental (return . ContIncremental . Just) =<< getStartTime + _ -> error "Specify only one of --incremental, --more, or --incremental-schedule" where startIncremental = do recordStartTime @@ -408,7 +410,7 @@ badContentRemote remote key = do ++ Remote.name remote data Incremental = StartIncremental | ContIncremental (Maybe EpochTime) | NonIncremental - deriving (Eq) + deriving (Eq, Show) runFsck :: Incremental -> FilePath -> Key -> Annex Bool -> CommandStart runFsck inc file key a = ifM (needFsck inc key) -- cgit v1.2.3