{-# LANGUAGE CPP #-}
module Development.IDE.GHC.Compat.CmdLine (
processCmdLineP
, CmdLineP (..)
, getCmdLineState
, putCmdLineState
, Flag(..)
, OptKind(..)
, EwM
, defFlag
, liftEwM
) where
#if MIN_VERSION_ghc(9,3,0)
import GHC.Driver.CmdLine
import GHC.Driver.Session (CmdLineP (..), getCmdLineState,
processCmdLineP, putCmdLineState)
#else
import Control.Monad.IO.Class
import GHC (Located)
import GHC.Driver.CmdLine
#endif
#if !MIN_VERSION_ghc(9,3,0)
processCmdLineP
:: forall s m. MonadIO m
=> [Flag (CmdLineP s)]
-> s
-> [Located String]
-> m (([Located String], [Err], [Warn]), s)
processCmdLineP activeFlags s0 args =
pure $ runCmdLine (processArgs activeFlags args) s0
#endif