@@ -7,7 +7,7 @@ import Control.Monad (when)
7
7
import Data.Aeson qualified as A
8
8
import Data.Bool (bool )
9
9
import Data.ByteString.Lazy.UTF8 qualified as LBU8
10
- import Data.List (intercalate )
10
+ import Data.List (intercalate , (\\) )
11
11
import Data.Map qualified as M
12
12
import Data.Set qualified as S
13
13
import Data.Text qualified as T
@@ -26,6 +26,7 @@ import System.IO.UTF8 (readUTF8FilesT)
26
26
27
27
data PSCMakeOptions = PSCMakeOptions
28
28
{ pscmInput :: [FilePath ]
29
+ , pscmExclude :: [FilePath ]
29
30
, pscmOutputDir :: FilePath
30
31
, pscmOpts :: P. Options
31
32
, pscmUsePrefix :: Bool
@@ -53,7 +54,9 @@ printWarningsAndErrors verbose True files warnings errors = do
53
54
54
55
compile :: PSCMakeOptions -> IO ()
55
56
compile PSCMakeOptions {.. } = do
56
- input <- globWarningOnMisses warnFileTypeNotFound pscmInput
57
+ included <- globWarningOnMisses warnFileTypeNotFound pscmInput
58
+ excluded <- globWarningOnMisses warnFileTypeNotFound pscmExclude
59
+ let input = included \\ excluded
57
60
when (null input) $ do
58
61
hPutStr stderr $ unlines [ " purs compile: No input files."
59
62
, " Usage: For basic information, try the `--help' option."
@@ -86,6 +89,12 @@ inputFile = Opts.strArgument $
86
89
Opts. metavar " FILE"
87
90
<> Opts. help " The input .purs file(s)."
88
91
92
+ excludedFiles :: Opts. Parser FilePath
93
+ excludedFiles = Opts. strOption $
94
+ Opts. short ' x'
95
+ <> Opts. long " exclude-files"
96
+ <> Opts. help " Glob of .purs files to exclude from the supplied files."
97
+
89
98
outputDirectory :: Opts. Parser FilePath
90
99
outputDirectory = Opts. strOption $
91
100
Opts. short ' o'
@@ -153,6 +162,7 @@ options =
153
162
154
163
pscMakeOptions :: Opts. Parser PSCMakeOptions
155
164
pscMakeOptions = PSCMakeOptions <$> many inputFile
165
+ <*> many excludedFiles
156
166
<*> outputDirectory
157
167
<*> options
158
168
<*> (not <$> noPrefix)
0 commit comments