projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c5a514d
)
Add GHCi completions to :set and :show
author
Ori Avtalion
<ori@avtalion.name>
Tue, 9 Dec 2008 19:42:10 +0000
(19:42 +0000)
committer
Ori Avtalion
<ori@avtalion.name>
Tue, 9 Dec 2008 19:42:10 +0000
(19:42 +0000)
compiler/ghci/InteractiveUI.hs
patch
|
blob
|
history
diff --git
a/compiler/ghci/InteractiveUI.hs
b/compiler/ghci/InteractiveUI.hs
index
54bdebb
..
c1062e7
100644
(file)
--- a/
compiler/ghci/InteractiveUI.hs
+++ b/
compiler/ghci/InteractiveUI.hs
@@
-143,7
+143,7
@@
builtin_commands = [
("reload", keepGoing reloadModule, Nothing, completeNone),
("run", keepGoing runRun, Nothing, completeIdentifier),
("set", keepGoing setCmd, Just flagWordBreakChars, completeSetOptions),
("reload", keepGoing reloadModule, Nothing, completeNone),
("run", keepGoing runRun, Nothing, completeIdentifier),
("set", keepGoing setCmd, Just flagWordBreakChars, completeSetOptions),
- ("show", keepGoing showCmd, Nothing, completeNone),
+ ("show", keepGoing showCmd, Nothing, completeShowOptions),
("sprint", keepGoing sprintCmd, Nothing, completeIdentifier),
("step", keepGoing stepCmd, Nothing, completeIdentifier),
("steplocal", keepGoing stepLocalCmd, Nothing, completeIdentifier),
("sprint", keepGoing sprintCmd, Nothing, completeIdentifier),
("step", keepGoing stepCmd, Nothing, completeIdentifier),
("steplocal", keepGoing stepLocalCmd, Nothing, completeIdentifier),
@@
-1749,9
+1749,15
@@
completeHomeModule w = do
completeSetOptions w = do
return (filter (w `isPrefixOf`) options)
completeSetOptions w = do
return (filter (w `isPrefixOf`) options)
- where options = "args":"prog":flagList
+ where options = "args":"prog":"prompt":"editor":"stop":flagList
flagList = map head $ group $ sort allFlags
flagList = map head $ group $ sort allFlags
+completeShowOptions w = do
+ return (filter (w `isPrefixOf`) options)
+ where options =
+ ["args", "prog", "prompt", "editor", "stop", "modules", "bindings",
+ "linker", "breaks", "context", "packages", "languages"]
+
completeFilename w = do
ws <- Readline.filenameCompletionFunction w
case ws of
completeFilename w = do
ws <- Readline.filenameCompletionFunction w
case ws of
@@
-1800,12
+1806,13
@@
allExposedModules dflags
where
pkg_db = pkgIdMap (pkgState dflags)
#else
where
pkg_db = pkgIdMap (pkgState dflags)
#else
-completeMacro = completeNone
-completeIdentifier = completeNone
-completeModule = completeNone
-completeHomeModule = completeNone
-completeSetOptions = completeNone
-completeFilename = completeNone
+completeMacro = completeNone
+completeIdentifier = completeNone
+completeModule = completeNone
+completeHomeModule = completeNone
+completeSetOptions = completeNone
+completeShowOptions = completeNone
+completeFilename = completeNone
completeHomeModuleOrFile=completeNone
#endif
completeHomeModuleOrFile=completeNone
#endif