diff options
author | Joey Hess <joey@kitenet.net> | 2011-09-18 20:41:51 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-09-18 20:42:15 -0400 |
commit | 33cd1ffbfe200188a4fc61fd5715e7aa29556d7f (patch) | |
tree | b21be384c89e29e2b56e5e1c5e1a931871837c27 /Limit.hs | |
parent | 9da23dff78d80158ba01a271ac2a32830fd9bccc (diff) |
make find show files meeting limits, even when not present
find: Rather than only showing files whose contents are present, when used
with --exclude --copies or --in, displays all files that match the
specified conditions.
Note that this is a behavior change for find --exclude! Old behavior
can be gotten with find --in . --exclude=...
Diffstat (limited to 'Limit.hs')
-rw-r--r-- | Limit.hs | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -10,6 +10,7 @@ module Limit where import Text.Regex.PCRE.Light.Char8 import System.Path.WildMatch import Control.Monad (filterM) +import Control.Applicative import Data.Maybe import Annex @@ -27,6 +28,10 @@ filterFiles l = do matcher <- getMatcher filterM (Utility.Matcher.matchM matcher) l +{- Checks if there are user-specified limits. -} +limited :: Annex Bool +limited = (not . Utility.Matcher.matchesAny) <$> getMatcher + {- Gets a matcher for the user-specified limits. The matcher is cached for - speed; once it's obtained the user-specified limits can't change. -} getMatcher :: Annex (Utility.Matcher.Matcher (FilePath -> Annex Bool)) |