diff options
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]) |