From ec1e12b32d5d600cf53602b5fd66e4a3c61ff853 Mon Sep 17 00:00:00 2001
From: Simon Marlow <marlowsd@gmail.com>
Date: Thu, 21 Jul 2011 14:55:20 +0100
Subject: [PATCH] show warning flags in :set (lost in the recent dopt->wopt
 change, noticed by test ghci024)

---
 ghc/InteractiveUI.hs | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 5b44097e1775..50914945fa94 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
-- 
GitLab