Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Command-line parser
This is an abstract command-line parser used by DynFlags.
(c) The University of Glasgow 2005
Synopsis
- processArgs :: Monad m => [Flag m] -> [Located String] -> (FilePath -> EwM m [Located String]) -> m ([Located String], [Err], [Warn])
- parseResponseFile :: MonadIO m => FilePath -> EwM m [Located String]
- data OptKind m
- = NoArg (EwM m ())
- | HasArg (String -> EwM m ())
- | SepArg (String -> EwM m ())
- | Prefix (String -> EwM m ())
- | OptPrefix (String -> EwM m ())
- | OptIntSuffix (Maybe Int -> EwM m ())
- | IntSuffix (Int -> EwM m ())
- | WordSuffix (Word -> EwM m ())
- | FloatSuffix (Float -> EwM m ())
- | PassFlag (String -> EwM m ())
- | AnySuffix (String -> EwM m ())
- data GhcFlagMode
- data Flag m = Flag {
- flagName :: String
- flagOptKind :: OptKind m
- flagGhcMode :: GhcFlagMode
- defFlag :: String -> OptKind m -> Flag m
- defGhcFlag :: String -> OptKind m -> Flag m
- defGhciFlag :: String -> OptKind m -> Flag m
- defHiddenFlag :: String -> OptKind m -> Flag m
- hoistFlag :: forall m n. (forall a. m a -> n a) -> Flag m -> Flag n
- errorsToGhcException :: [(String, String)] -> GhcException
- newtype Err = Err {}
- data Warn = Warn {}
- data WarnReason
- data EwM m a
- runEwM :: EwM m a -> m (Errs, Warns, a)
- addErr :: Monad m => String -> EwM m ()
- addWarn :: Monad m => String -> EwM m ()
- addFlagWarn :: Monad m => DiagnosticReason -> String -> EwM m ()
- getArg :: Monad m => EwM m String
- getCurLoc :: Monad m => EwM m SrcSpan
- liftEwM :: Monad m => m a -> EwM m a
Documentation
parseResponseFile :: MonadIO m => FilePath -> EwM m [Located String] Source #
Parse a response file into arguments.
NoArg (EwM m ()) | |
HasArg (String -> EwM m ()) | |
SepArg (String -> EwM m ()) | |
Prefix (String -> EwM m ()) | |
OptPrefix (String -> EwM m ()) | |
OptIntSuffix (Maybe Int -> EwM m ()) | |
IntSuffix (Int -> EwM m ()) | |
WordSuffix (Word -> EwM m ()) | |
FloatSuffix (Float -> EwM m ()) | |
PassFlag (String -> EwM m ()) | |
AnySuffix (String -> EwM m ()) |
data GhcFlagMode Source #
GHC flag modes describing when a flag has an effect.
OnlyGhc | The flag only affects the non-interactive GHC |
OnlyGhci | The flag only affects the interactive GHC |
AllModes | The flag affects multiple ghc modes |
HiddenFlag | This flag should not be seen in cli completion |
Flag | |
|
errorsToGhcException :: [(String, String)] -> GhcException Source #
A command-line warning message and the reason it arose
data WarnReason Source #
Used when filtering warnings: if a reason is given it can be filtered out when displaying.
Instances
Show WarnReason Source # | |
Defined in GHC.Driver.CmdLine | |
ToJson WarnReason Source # | |
Defined in GHC.Driver.CmdLine json :: WarnReason -> JsonDoc Source # | |
Outputable WarnReason Source # | |
Defined in GHC.Driver.CmdLine ppr :: WarnReason -> SDoc Source # | |
Eq WarnReason Source # | |
Defined in GHC.Driver.CmdLine (==) :: WarnReason -> WarnReason -> Bool # (/=) :: WarnReason -> WarnReason -> Bool # |
addFlagWarn :: Monad m => DiagnosticReason -> String -> EwM m () Source #