[add ability to filter grep results based on name type. make commands not case sensitive.
John Meacham <john@repetae.net>**20051202041105] hunk ./Interactive.hs 27
-{-
- 'f' - normal value
- 'C' - data constructor
- 'T' - type constructor
- 'L' - class
- '?' - odd
--}
+grep_opts = [
+ "f - match normal value",
+ "C - match data constructor",
+ "T - match type constructor",
+ "L - match class"
+ ]
hunk ./Interactive.hs 50
-        putStrLn ":grep <regex>"
+        putStrLn ":grep [options] <regex>"
+        putStrLn "Valid options:"
+        putStr $ unlines grep_opts
hunk ./Interactive.hs 55
-        rx <- catch ( Just `fmap` regcomp arg regExtended) (\_ -> return Nothing)
+        let (opt,reg) = case simpleUnquote arg of
+                [x] -> ("TCLf",x)
+                xs -> f "" xs where
+            f opt [x] = (opt,x)
+            f opt (x:xs) = f (x ++ opt) xs
+        rx <- catch ( Just `fmap` regcomp reg regExtended) (\_ -> return Nothing)
hunk ./Interactive.hs 63
-            Just rx -> mapM_ putStrLn $ sort [ nameTag (nameType v):' ':show v | v <- Map.keys (hoDefs ho), isJust (matchRegex rx (show v)) ]
+            Just rx -> mapM_ putStrLn $ sort [ nameTag (nameType v):' ':show v | v <- Map.keys (hoDefs ho), isJust (matchRegex rx (show v)), nameTag (nameType v) `elem` opt ]
hunk ./Util/Interact.hs 50
-    f (':':rs) = Left (':':as,dropWhile isSpace rest) where
+    f (':':rs) = Left (':':map toLower as,dropWhile isSpace rest) where