From: Simon Marlow Date: Tue, 8 May 2007 13:57:07 +0000 (+0000) Subject: let you :show things that you can :set (e.g. args, prog etc.) X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=d5c0de4518422315f0179121b222b0e3c7d82d86 let you :show things that you can :set (e.g. args, prog etc.) --- diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index a1d803c..3a76f92 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -1154,14 +1154,20 @@ optToStr RevertCAFs = "r" -- --------------------------------------------------------------------------- -- code for `:show' -showCmd str = +showCmd str = do + st <- getGHCiState case words str of + ["args"] -> io $ putStrLn (show (args st)) + ["prog"] -> io $ putStrLn (show (progname st)) + ["prompt"] -> io $ putStrLn (show (prompt st)) + ["editor"] -> io $ putStrLn (show (editor st)) + ["stop"] -> io $ putStrLn (show (stop st)) ["modules" ] -> showModules ["bindings"] -> showBindings ["linker"] -> io showLinkerState - ["breaks"] -> showBkptTable - ["context"] -> showContext - _ -> throwDyn (CmdLineError "syntax: :show [modules|bindings|breaks]") + ["breaks"] -> showBkptTable + ["context"] -> showContext + _ -> throwDyn (CmdLineError "syntax: :show [args|prog|prompt|editor|stop|modules|bindings|breaks|context]") showModules = do session <- getSession