log --before=date

This commit is contained in:
Joey Hess 2012-01-06 21:27:42 -04:00
parent 539f8c6f14
commit 8e7de01047
3 changed files with 28 additions and 24 deletions

10
Seek.hs
View file

@ -88,14 +88,18 @@ withKeys a params = return $ map (a . parse) params
where
parse p = fromMaybe (error "bad key") $ readKey p
withValue :: Annex v -> (v -> CommandSeek) -> CommandSeek
withValue v a params = do
r <- v
a r params
{- Modifies a seek action using the value of a field option, which is fed into
- a conversion function, and then is passed into the seek action.
- This ensures that the conversion function only runs once.
-}
withField :: Option -> (Maybe String -> Annex a) -> (a -> CommandSeek) -> CommandSeek
withField option converter a ps = do
f <- converter =<< Annex.getField (Option.name option)
a f ps
withField option converter = withValue $
converter =<< Annex.getField (Option.name option)
withNothing :: CommandStart -> CommandSeek
withNothing a [] = return [a]