summaryrefslogtreecommitdiff
path: root/Seek.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-01-06 10:14:37 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-01-06 10:57:57 -0400
commit1f8a1058c96bd4ee11fcb353f0ede1842d79ab6a (patch)
tree0754233445da5c75737aa2b7866881d30939ec56 /Seek.hs
parentdf21cbfdd2b7342c206ebd4aea32d989328374dc (diff)
tweak
Diffstat (limited to 'Seek.hs')
-rw-r--r--Seek.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Seek.hs b/Seek.hs
index 53101b23e..fdb117de0 100644
--- a/Seek.hs
+++ b/Seek.hs
@@ -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