Skip to content

Commit d5b8c6e

Browse files
Allow exec and ghci commands in interpreter mode
fixes #2510
1 parent 03da292 commit d5b8c6e

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/main/Main.hs

+13-13
Original file line numberDiff line numberDiff line change
@@ -313,22 +313,10 @@ commandLineHandler progName isInterpreter = complicatedOptions
313313
"Visualize your project's dependency graph using Graphviz dot"
314314
dotCmd
315315
dotOptsParser
316-
addCommand' "exec"
317-
"Execute a command"
318-
execCmd
319-
(execOptsParser Nothing)
320316
addCommand' "ghc"
321317
"Run ghc"
322318
execCmd
323319
(execOptsParser $ Just ExecGhc)
324-
addCommand' "ghci"
325-
"Run ghci in the context of package(s) (experimental)"
326-
ghciCmd
327-
ghciOptsParser
328-
addCommand' "repl"
329-
"Run ghci in the context of package(s) (experimental) (alias for 'ghci')"
330-
ghciCmd
331-
ghciOptsParser
332320
addCommand' "hoogle"
333321
"Run hoogle in the context of the current Stack config"
334322
hoogleCmd
@@ -343,7 +331,19 @@ commandLineHandler progName isInterpreter = complicatedOptions
343331
help "Rebuild the hoogle database"))
344332
)
345333

346-
-- These two are the only commands allowed in interpreter mode as well
334+
-- These are the only commands allowed in interpreter mode as well
335+
addCommand' "exec"
336+
"Execute a command"
337+
execCmd
338+
(execOptsParser Nothing)
339+
addCommand' "ghci"
340+
"Run ghci in the context of package(s) (experimental)"
341+
ghciCmd
342+
ghciOptsParser
343+
addCommand' "repl"
344+
"Run ghci in the context of package(s) (experimental) (alias for 'ghci')"
345+
ghciCmd
346+
ghciOptsParser
347347
addCommand' "runghc"
348348
"Run runghc"
349349
execCmd

0 commit comments

Comments
 (0)