diff options
author | Simon Marlow <marlowsd@gmail.com> | 2011-07-21 14:55:20 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-07-21 14:58:24 +0100 |
commit | c555564086869132fcc21354be80dcfe3e54642a (patch) | |
tree | 73cf99586ab12165dfa4b430478158701decb351 /ghc | |
parent | a592f6b40d59aa496dc5f59bd9e59d797ec1c6e1 (diff) | |
download | haskell-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.hs | 24 |
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 |