Permalink
Browse files

Revert "Add command line option for excluding files matching pattern."

Just found the built-in -f switch.

This reverts commit 202eac0.
  • Loading branch information...
1 parent 202eac0 commit c87f981b004fa5a924f373bdbe561c41b5a3f8a1 @arvidj committed Sep 17, 2012
Showing with 5 additions and 21 deletions.
  1. +1 −1 lex-pass.cabal
  2. +3 −11 src/Config.hs
  3. +1 −4 src/Main.hs
  4. +0 −5 src/Options.hs
View
@@ -21,7 +21,7 @@ executable lex-pass
main-is: Main.hs
build-depends: FUtil, HSH >= 2, MissingH, base >= 4, binary, bytestring,
containers, derive, directory, filepath, mtl, parsec == 3.*,
- process, syb, regex-compat
+ process, syb
ghc-options: -threaded
executable lex-pass-test
View
@@ -4,15 +4,7 @@ import Data.List
import HSH
-- put any custom default excluded directories or aliased filetypes here etc
-sourceFiles :: [String] -> [String] -> String -> IO [String]
-sourceFiles ftypes exlcDirs dir = run (findCommand ftypes exlcDirs dir)
+sourceFiles :: [String] -> String -> IO [String]
+sourceFiles ftypes dir = run ("find", dir:args) where
+ args = intercalate ["-or"] [["-iname", "*." ++ ftype] | ftype <- ftypes]
-findCommand :: [String] -> [String] -> String -> (String, [String])
-findCommand ftypes exclDirs dir = ("find", allArgs) where
- allArgs = dir:(exclArgs ++ inclArgs ++ ["-print"])
- inclArgs = orArgs [["-iname", "*." ++ ftype] | ftype <- ftypes]
- exclArgs = if exclDirs /= []
- then (paren . orArgs $ [["-wholename", dir] | dir <- exclDirs]) ++ ["-prune", "-o"]
- else []
- paren args = ["("] ++ args ++ [")"]
- orArgs = intercalate ["-or"]
View
@@ -12,7 +12,6 @@ import System.Environment
import System.FilePath
import System.IO
import System.Process
-import Text.Regex
import CodeGen.Transf
import LexPassUtil
@@ -92,9 +91,7 @@ main = do
transf = lookupTrans transfName
subPaths <- map killInitialDotSlash <$> if optFiles opts
then getContents >>= return . lines
- else Config.sourceFiles (transfTypes transf)
- (maybe [] (\p -> splitRegex (mkRegex ",") p) (optExclPats opts))
- dir
+ else Config.sourceFiles (transfTypes transf) dir
let
subPaths' = case optStartAtFile opts of
Nothing -> subPaths
View
@@ -7,7 +7,6 @@ data Options = Options {
optNumCores :: Int,
optFiles :: Bool,
optDir :: Maybe String,
- optExclPats :: Maybe String,
optStartAtFile :: Maybe String}
deriving Show
@@ -17,7 +16,6 @@ defaultOptions = Options {
optNumCores = 1,
optFiles = False,
optDir = Nothing,
- optExclPats = Nothing,
optStartAtFile = Nothing}
options :: [OptDescr (Options -> Options)]
@@ -34,9 +32,6 @@ options = [
\files of interest. Abstract syntax trees\n\
\will be cached in top-level .ast/\n\
\directory.",
- Option "e" ["exclude"]
- (ReqArg (\ d opts -> opts {optExclPats = Just d}) "<patterns>")
- "Exclude files patterns. ",
Option "f" ["files"]
(NoArg (\ opts -> opts {optFiles = True}))
"Pass a specific list of files to stdin\n\

0 comments on commit c87f981

Please sign in to comment.