{-# LANGUAGE CPP #-}
{-# LANGUAGE RankNTypes #-}
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.Session (processCmdLineP, CmdLineP (..), getCmdLineState, putCmdLineState)
import GHC.Driver.CmdLine
#else
import GHC.Driver.CmdLine
import Control.Monad.IO.Class
import GHC (Located)
#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