diff options
| author | Ori Avtalion <ori@avtalion.name> | 2008-12-09 19:42:10 +0000 |
|---|---|---|
| committer | Ori Avtalion <ori@avtalion.name> | 2008-12-09 19:42:10 +0000 |
| commit | 2204a484bd6899cf57e3d13c3ee471558ae43b93 (patch) | |
| tree | fc17512e0b0adb5a53154013f3d1e1acafc5362a /compiler/ghci | |
| parent | c5a514d1d44d46f59b6255c3e432b1bbe384c937 (diff) | |
| download | haskell-2204a484bd6899cf57e3d13c3ee471558ae43b93.tar.gz | |
Add GHCi completions to :set and :show
Diffstat (limited to 'compiler/ghci')
| -rw-r--r-- | compiler/ghci/InteractiveUI.hs | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index 54bdebb0e7..c1062e7138 100644 --- 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), - ("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), @@ -1749,9 +1749,15 @@ completeHomeModule w = do 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 +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 @@ -1800,12 +1806,13 @@ allExposedModules dflags 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 |
