Do not use deprecated API for parseCmdLineOptions

Thanks to @lierdakil
This commit is contained in:
Alan Zimmerman 2016-02-29 20:45:32 +02:00
parent 4aef60940e
commit 45eb3b8d4c

View File

@ -35,18 +35,7 @@ import Language.Haskell.GhcMod.Options.Help
-- | Parse a set of arguments according to the ghc-mod CLI flag spec, producing -- | Parse a set of arguments according to the ghc-mod CLI flag spec, producing
-- @Options@ set accordingly. -- @Options@ set accordingly.
parseCmdLineOptions :: [String] -> Maybe Options parseCmdLineOptions :: [String] -> Maybe Options
parseCmdLineOptions args = execParserMaybe parserInfo args parseCmdLineOptions = getParseResult . execParserPure (prefs mempty) (info globalArgSpec mempty)
where
parserInfo
= ParserInfo
{ infoParser = globalArgSpec
, infoFullDesc = True
, infoProgDesc = Chunk Nothing
, infoHeader = Chunk Nothing
, infoFooter = Chunk Nothing
, infoFailureCode = -1
, infoIntersperse = True
}
splitOn :: Eq a => a -> [a] -> ([a], [a]) splitOn :: Eq a => a -> [a] -> ([a], [a])
splitOn c = second (drop 1) . break (==c) splitOn c = second (drop 1) . break (==c)