diff options
author | Joey Hess <joey@kitenet.net> | 2011-05-17 03:10:13 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-05-17 03:13:11 -0400 |
commit | c91929f6934fc4e94603d0fa004e824d5e2cfb65 (patch) | |
tree | e958f5b4dc1209afb90c786493164c351dea4b9a /Command/Find.hs | |
parent | 75a3f5027f74565d909fb940893636d081d9872a (diff) |
add whenM and unlessM
Just more golfing.. I am pretty sure something in a library somewhere can
do this, but I have been unable to find it.
Diffstat (limited to 'Command/Find.hs')
-rw-r--r-- | Command/Find.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Command/Find.hs b/Command/Find.hs index eecf3cd7d..9d760ff5a 100644 --- a/Command/Find.hs +++ b/Command/Find.hs @@ -7,11 +7,11 @@ module Command.Find where -import Control.Monad (when) import Control.Monad.State (liftIO) import Command import Content +import Utility command :: [Command] command = [repoCommand "find" (paramOptional $ paramRepeating paramPath) seek @@ -23,6 +23,5 @@ seek = [withFilesInGit start] {- Output a list of files. -} start :: CommandStartString start file = isAnnexed file $ \(key, _) -> do - exists <- inAnnex key - when exists $ liftIO $ putStrLn file + whenM (inAnnex key) $ liftIO $ putStrLn file stop |