diff options
author | Patrick Palka <patrick@parcs.ath.cx> | 2013-08-30 12:54:22 -0400 |
---|---|---|
committer | Patrick Palka <patrick@parcs.ath.cx> | 2013-08-30 12:54:22 -0400 |
commit | 26bf3dd478dce53eb50c2ce13821d61e416e3fe7 (patch) | |
tree | 7b025b1eca208e96cf5e1916dd12f0054fda79ea /ghc | |
parent | 6d755c08ca125d991a95fbdc3ae1dc0608b722f1 (diff) | |
parent | 85c1715d086bf2d35bc05133398f462919f2aa7b (diff) | |
download | haskell-26bf3dd478dce53eb50c2ce13821d61e416e3fe7.tar.gz |
Merge branch 'master' into ghc-parmake-gsoc
Conflicts:
compiler/main/DynFlags.hs
compiler/utils/FastString.lhs
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/InteractiveUI.hs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index 7b7e0a67d1..b42356fc06 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -246,7 +246,8 @@ defFullHelpText = " :info[!] [<name> ...] display information about the given names\n" ++ " (!: do not filter instances)\n" ++ " :issafe [<mod>] display safe haskell information of module <mod>\n" ++ - " :kind <type> show the kind of <type>\n" ++ + " :kind[!] <type> show the kind of <type>\n" ++ + " (!: also print the normalised type)\n" ++ " :load [*]<module> ... load module(s) and their dependents\n" ++ " :main [<arguments> ...] run the main function with the given arguments\n" ++ " :module [+/-] [*]<mod> ... set the context for expression evaluation\n" ++ @@ -315,6 +316,7 @@ defFullHelpText = " :show linker show current linker state\n" ++ " :show modules show the currently loaded modules\n" ++ " :show packages show the currently active package flags\n" ++ + " :show paths show the currently active search paths\n" ++ " :show language show the currently active language flags\n" ++ " :show <setting> show value of <setting>, which is one of\n" ++ " [args, prog, prompt, editor, stop]\n" ++ @@ -2166,6 +2168,7 @@ showCmd str = do ["breaks"] -> showBkptTable ["context"] -> showContext ["packages"] -> showPackages + ["paths"] -> showPaths ["languages"] -> showLanguages -- backwards compat ["language"] -> showLanguages ["lang"] -> showLanguages -- useful abbreviation @@ -2273,6 +2276,19 @@ showPackages = do showFlag (TrustPackage p) = text $ " -trust " ++ p showFlag (DistrustPackage p) = text $ " -distrust " ++ p +showPaths :: GHCi () +showPaths = do + dflags <- getDynFlags + liftIO $ do + cwd <- getCurrentDirectory + putStrLn $ showSDoc dflags $ + text "current working directory: " $$ + nest 2 (text cwd) + let ipaths = importPaths dflags + putStrLn $ showSDoc dflags $ + text ("module import search paths:"++if null ipaths then " none" else "") $$ + nest 2 (vcat (map text ipaths)) + showLanguages :: GHCi () showLanguages = getDynFlags >>= liftIO . showLanguages' False @@ -2433,7 +2449,7 @@ completeShowOptions = wrapCompleter flagWordBreakChars $ \w -> do return (filter (w `isPrefixOf`) opts) where opts = ["args", "prog", "prompt", "prompt2", "editor", "stop", "modules", "bindings", "linker", "breaks", - "context", "packages", "language", "imports"] + "context", "packages", "paths", "language", "imports"] completeShowiOptions = wrapCompleter flagWordBreakChars $ \w -> do return (filter (w `isPrefixOf`) ["language"]) |