diff options
author | 2012-01-06 10:14:37 -0400 | |
---|---|---|
committer | 2012-01-06 10:57:57 -0400 | |
commit | 1f8a1058c96bd4ee11fcb353f0ede1842d79ab6a (patch) | |
tree | 0754233445da5c75737aa2b7866881d30939ec56 /Seek.hs | |
parent | df21cbfdd2b7342c206ebd4aea32d989328374dc (diff) |
tweak
Diffstat (limited to 'Seek.hs')
-rw-r--r-- | Seek.hs | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -20,6 +20,7 @@ import qualified Git import qualified Git.LsFiles as LsFiles import qualified Git.CheckAttr import qualified Limit +import qualified Option seekHelper :: ([FilePath] -> Git.Repo -> IO [FilePath]) -> [FilePath] -> Annex [FilePath] seekHelper a params = do @@ -87,13 +88,13 @@ withKeys a params = return $ map (a . parse) params where parse p = fromMaybe (error "bad key") $ readKey p -{- Modifies a seek action using the value of a field, which is fed into +{- 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 :: String -> (Maybe String -> Annex a) -> (a -> CommandSeek) -> CommandSeek -withField field converter a ps = do - f <- converter =<< Annex.getField field +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 withNothing :: CommandStart -> CommandSeek |