summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-07-21 14:55:20 +0100
committerSimon Marlow <marlowsd@gmail.com>2011-07-21 14:58:24 +0100
commitc555564086869132fcc21354be80dcfe3e54642a (patch)
tree73cf99586ab12165dfa4b430478158701decb351 /ghc
parenta592f6b40d59aa496dc5f59bd9e59d797ec1c6e1 (diff)
downloadhaskell-c555564086869132fcc21354be80dcfe3e54642a.tar.gz
show warning flags in :set (lost in the recent dopt->wopt change,
noticed by test ghci024)
Diffstat (limited to 'ghc')
-rw-r--r--ghc/InteractiveUI.hs24
1 files changed, 18 insertions, 6 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 5b44097e17..50914945fa 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -1609,16 +1609,28 @@ setCmd ""
))
dflags <- getDynFlags
liftIO $ putStrLn (showSDoc (
- vcat (text "GHCi-specific dynamic flag settings:"
- :map (flagSetting dflags) ghciFlags)
+ text "GHCi-specific dynamic flag settings:" $$
+ nest 2 (vcat (map (flagSetting dflags) ghciFlags))
))
liftIO $ putStrLn (showSDoc (
- vcat (text "other dynamic, non-language, flag settings:"
- :map (flagSetting dflags) others)
+ text "other dynamic, non-language, flag settings:" $$
+ nest 2 (vcat (map (flagSetting dflags) others))
))
+ liftIO $ putStrLn (showSDoc (
+ text "warning settings:" $$
+ nest 2 (vcat (map (warnSetting dflags) DynFlags.fWarningFlags))
+ ))
+
where flagSetting dflags (str, _, f, _)
- | dopt f dflags = text " " <> text "-f" <> text str
- | otherwise = text " " <> text "-fno-" <> text str
+ | dopt f dflags = fstr str
+ | otherwise = fnostr str
+ warnSetting dflags (str, _, f, _)
+ | wopt f dflags = fstr str
+ | otherwise = fnostr str
+
+ fstr str = text "-f" <> text str
+ fnostr str = text "-fno-" <> text str
+
(ghciFlags,others) = partition (\(_, _, f, _) -> f `elem` flags)
DynFlags.fFlags
flags = [Opt_PrintExplicitForalls