diff options
author | Joey Hess <joey@kitenet.net> | 2014-02-20 15:56:45 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-02-20 15:56:45 -0400 |
commit | e8dd341a562e3ef7926f5f51009f4b71bdc4dad9 (patch) | |
tree | 7913041d8dce2ed1d96f7b63b24d46e8c10a1d42 /Command | |
parent | 805340f3304fbc2962ce334f4d887c4cbf28395c (diff) |
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.
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Fsck.hs | 8 |
1 files changed, 5 insertions, 3 deletions
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) |