From effc285ff0be62636148d66bb4bf0002baaf14e8 Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 18 Jan 2006 10:49:32 +0000 Subject: [PATCH] [project @ 2006-01-18 10:49:32 by simonmar] Implement :main (see ticket #662) Patch from Volker Stolz, minor mods by me When matching commands, we now look for (a) an exact match, and (b) the first prefix match we find in the list. This is so that :module can still be abbreviated by :m, to avoid surprise. Docs still to do. --- ghc/compiler/ghci/InteractiveUI.hs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index 112e672..dd4343f 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -104,6 +104,7 @@ builtin_commands = [ ("info", keepGoing info), ("load", keepGoingPaths loadModule_), ("module", keepGoing setContext), + ("main", keepGoing runMain), ("reload", keepGoing reloadModule), ("check", keepGoing checkModule), ("set", keepGoing setCmd), @@ -138,6 +139,7 @@ helpText = " :info [ ...] display information about the given names\n" ++ " :load ... load module(s) and their dependents\n" ++ " :module [+/-] [*] ... set the context for expression evaluation\n" ++ + " :main [ ...] run the main function with the given arguments\n" ++ " :reload reload the current module set\n" ++ "\n" ++ " :set