Remove the large ghci banner, and the flags to choose which banner to show
authorIan Lynagh <igloo@earth.li>
Mon, 2 Jul 2007 11:01:55 +0000 (11:01 +0000)
committerIan Lynagh <igloo@earth.li>
Mon, 2 Jul 2007 11:01:55 +0000 (11:01 +0000)
Fans of the banner can add
    putStrLn "   ___         ___ _"
    putStrLn "  / _ \\ /\\  /\\/ __(_)"
    putStrLn " / /_\\// /_/ / /  | |   GHC Interactive, for Haskell 98."
    putStrLn "/ /_\\\\/ __  / /___| |   http://www.haskell.org/ghc/"
    putStrLn "\\____/\\/ /_/\\____/|_|   Type :? for help."
    putStrLn ""
to their ~/.ghci

compiler/ghci/InteractiveUI.hs
compiler/main/DynFlags.hs
compiler/main/Main.hs
docs/users_guide/flags.xml

index fe32e83..e1c9231 100644 (file)
@@ -6,7 +6,7 @@
 -- (c) The GHC Team 2005-2006
 --
 -----------------------------------------------------------------------------
-module InteractiveUI ( interactiveUI ) where
+module InteractiveUI ( interactiveUI, ghciWelcomeMsg ) where
 
 #include "HsVersions.h"
 
@@ -81,16 +81,9 @@ import System.Posix.Internals ( setNonBlockingFD )
 
 -----------------------------------------------------------------------------
 
-ghciWelcomeMsg =
- "   ___         ___ _\n"++
- "  / _ \\ /\\  /\\/ __(_)\n"++
- " / /_\\// /_/ / /  | |    GHC Interactive, version " ++ cProjectVersion ++ ", for Haskell 98.\n"++
- "/ /_\\\\/ __  / /___| |    http://www.haskell.org/ghc/\n"++
- "\\____/\\/ /_/\\____/|_|    Type :? for help.\n"
-
-ghciShortWelcomeMsg =
-    "GHCi, version " ++ cProjectVersion ++
-    ": http://www.haskell.org/ghc/  :? for help"
+ghciWelcomeMsg :: String
+ghciWelcomeMsg = "GHCi, version " ++ cProjectVersion ++
+                 ": http://www.haskell.org/ghc/  :? for help"
 
 type Command = (String, String -> GHCi Bool, Bool, String -> IO [String])
 cmdName (n,_,_,_) = n
@@ -366,11 +359,6 @@ runGHCi paths maybe_expr = do
             -- initialise the console if necessary
             io setUpConsole
 
-            let msg = if dopt Opt_ShortGhciBanner dflags
-                      then ghciShortWelcomeMsg
-                      else ghciWelcomeMsg
-            when (verbosity dflags >= 1) $ io $ putStrLn msg
-
             -- enter the interactive loop
             interactiveLoop is_tty show_prompt
         Just expr -> do
index 422b220..82f0cfe 100644 (file)
@@ -201,7 +201,6 @@ data DynFlag
    | Opt_RewriteRules
 
    -- misc opts
-   | Opt_ShortGhciBanner
    | Opt_Cpp
    | Opt_Pp
    | Opt_ForceRecomp
@@ -843,8 +842,6 @@ dynamic_flags = [
   ,  ( "F"             , NoArg  (setDynFlag Opt_Pp))
   ,  ( "#include"      , HasArg (addCmdlineHCInclude) )
   ,  ( "v"             , OptIntSuffix setVerbosity )
-  ,  ( "short-ghci-banner", NoArg (setDynFlag Opt_ShortGhciBanner) )
-  ,  ( "long-ghci-banner" , NoArg (unSetDynFlag Opt_ShortGhciBanner) )
 
         ------- Specific phases  --------------------------------------------
   ,  ( "pgmL"           , HasArg (upd . setPgmL) )  
index c9d723d..e9c8343 100644 (file)
@@ -24,7 +24,7 @@ import HscMain          ( newHscEnv )
 import DriverPipeline  ( oneShot, compileFile )
 import DriverMkDepend  ( doMkDependHS )
 #ifdef GHCI
-import InteractiveUI   ( interactiveUI )
+import InteractiveUI   ( interactiveUI, ghciWelcomeMsg )
 #endif
 
 -- Various other random stuff that we need
@@ -428,6 +428,11 @@ showBanner :: CmdLineMode -> DynFlags -> IO ()
 showBanner cli_mode dflags = do
    let verb = verbosity dflags
 
+#ifdef GHCI
+   -- Show the GHCi banner
+   when (isInteractiveMode cli_mode && verb >= 1) $ putStrLn ghciWelcomeMsg
+#endif
+
    -- Display details of the configuration in verbose mode
    when (verb >= 2) $
     do hPutStr stderr "Glasgow Haskell Compiler, Version "
index b84cc22..b27b756 100644 (file)
              <entry>-</entry>
            </row>
            <row>
-             <entry><option>-short-ghci-banner</option></entry>
-             <entry>Display a one-line banner at GHCi startup</entry>
-             <entry>dynamic</entry>
-             <entry>-</entry>
-           </row>
-           <row>
-             <entry><option>-long-ghci-banner</option></entry>
-             <entry>Display a full banner at GHCi startup</entry>
-             <entry>dynamic</entry>
-             <entry>-</entry>
-           </row>
-           <row>
              <entry><option>-fdebugging</option></entry>
              <entry>Generate bytecode enabled for debugging</entry>
              <entry>dynamic</entry>