aboutsummaryrefslogtreecommitdiff
path: root/Limit.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-09-18 18:21:42 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-09-18 18:21:42 -0400
commitb9aa944b09e60badb99c65a87f5689e0ab9010e3 (patch)
treef7e72ecc47114f95a8989501b5935306ac2ebe7f /Limit.hs
parent8a5a92480b9dcf691af1e8c4849cb71c4158b845 (diff)
add --and --or --not -( and -)
I dislike -( and -), but without using a different option parser, can't easily use bare parens. --and and --or will become more useful once there are more interesting limits than --exclude
Diffstat (limited to 'Limit.hs')
-rw-r--r--Limit.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Limit.hs b/Limit.hs
index 324baee2e..91ea3453c 100644
--- a/Limit.hs
+++ b/Limit.hs
@@ -35,7 +35,7 @@ getMatcher = do
Annex.changeState $ \s -> s { Annex.limit = Right matcher }
return matcher
-{- Adds something to the limit list. -}
+{- Adds something to the limit list, which is built up reversed. -}
add :: Limit -> Annex ()
add l = Annex.changeState $ \s -> s { Annex.limit = append $ Annex.limit s }
where
@@ -43,16 +43,16 @@ add l = Annex.changeState $ \s -> s { Annex.limit = append $ Annex.limit s }
append _ = error "internal"
{- Adds a new limit. -}
-addl :: (FilePath -> Annex Bool) -> Annex ()
-addl = add . Utility.Matcher.Operation
+addlimit :: (FilePath -> Annex Bool) -> Annex ()
+addlimit = add . Utility.Matcher.Operation
{- Adds a new token. -}
-addt :: String -> Annex ()
-addt = add . Utility.Matcher.Token
+token :: String -> Annex ()
+token = add . Utility.Matcher.Token
{- Add a limit to skip files that do not match the glob. -}
exclude :: String -> Annex ()
-exclude glob = addl $ return . notExcluded
+exclude glob = addlimit $ return . notExcluded
where
notExcluded f = isNothing $ match cregex f []
cregex = compile regex []