Permalink
Browse files

Pass-thru `--info` and similar to support new "cabal repl" facility

This allows `ghci-ng` to be used in via the new "cabal repl" feature
(see haskell/cabal#1404) as in

  cabal repl --with-ghc=ghci-ng"

This workaround is needed as "cabal repl" calls "ghc --info" for
detecting properties of the installed GHC.
  • Loading branch information...
1 parent 3f88d15 commit 941fa170ba92c82b08d52672075cfa36184bc093 @hvr committed Aug 19, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 ghc/Main.hs
View
@@ -85,7 +85,11 @@ main = do
hSetBuffering stderr NoBuffering
GHC.defaultErrorHandler defaultFatalMessager defaultFlushOut $ do
-- 1. extract the -B flag from the args
- argv0 <- fmap (("--interactive" :) . (("-B" ++ GHC.Paths.libdir) :)) getArgs
+ argv00 <- getArgs
+ let argv0 = ("-B" ++ GHC.Paths.libdir) :
+ if any (`elem` argv00) ["--info", "--interactive", "--make", "-c"]
+ then argv00 -- needed for "cabal repl --with-ghc=ghci-ng"
+ else "--interactive" : argv00
let (minusB_args, argv1) = partition ("-B" `isPrefixOf`) argv0
mbMinusB | null minusB_args = Nothing

0 comments on commit 941fa17

Please sign in to comment.