diff options
| author | Joris | 2015-09-01 15:18:57 +0200 |
|---|---|---|
| committer | Joris | 2015-09-01 15:19:01 +0200 |
| commit | a45cffb45e751275b30f558109c21d8c6507e07d (patch) | |
| tree | 6d722f5781f0dac6f134f3d857b3ce0628ebe5e1 /src/CommandLineOptions.hs | |
| parent | d528036eae405f335498b57c2907c9269dc1554a (diff) | |
Add a command line option to ignore materials
Diffstat (limited to 'src/CommandLineOptions.hs')
| -rw-r--r-- | src/CommandLineOptions.hs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/CommandLineOptions.hs b/src/CommandLineOptions.hs index bb0ac8d..9f8d849 100644 --- a/src/CommandLineOptions.hs +++ b/src/CommandLineOptions.hs @@ -1,15 +1,20 @@ +{-# LANGUAGE OverloadedStrings #-} + module CommandLineOptions - ( parseOptions + ( Options(..) + , parseOptions ) where +import Data.Text (Text) + data Options = Options - { materials :: [String] - , ignoreMaterials :: [String] - } + { materials :: [Text] + , ignoreMaterials :: [Text] + } deriving (Eq, Show) -parseOptions :: [String] -> Options +parseOptions :: [Text] -> Options parseOptions args = - case splitWhere (== "--ignore") args of + case splitWhere (== "--without") args of (materials, ignoredMaterials) -> Options materials ignoredMaterials splitWhere :: (a -> Bool) -> [a] -> ([a], [a]) |
