summaryrefslogtreecommitdiff
path: root/Command.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-14 12:35:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-14 12:35:05 -0400
commita5c4dd974396d1dc9c3e55381215a904fa997cd2 (patch)
tree8f7f98fab145050b7f99ffe3358a7b616f171dd9 /Command.hs
parent54d0f73e67135ec675953d608d0780dfbb130f5d (diff)
find: New subcommand.
Diffstat (limited to 'Command.hs')
-rw-r--r--Command.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Command.hs b/Command.hs
index 40a21cacc..60d82d09f 100644
--- a/Command.hs
+++ b/Command.hs
@@ -158,6 +158,13 @@ withAll w a params = do
w a [Git.workTree g]
else w a params
+{- Provides a default parameter to a with search. -}
+withDefault :: String-> SubCmdSeekStrings -> SubCmdSeekStrings
+withDefault d w a params = do
+ if null params
+ then w a [d]
+ else w a params
+
{- filter out files from the state directory -}
notState :: FilePath -> Bool
notState f = stateLoc /= take (length stateLoc) f