bootInfo uses boot.

This commit is contained in:
Kazu Yamamoto 2014-04-30 10:39:39 +09:00
parent d007fa817a
commit bb8df8cbdf
3 changed files with 9 additions and 11 deletions

View File

@ -5,17 +5,15 @@ import CoreMonad (liftIO)
import GHC (Ghc) import GHC (Ghc)
import Language.Haskell.GhcMod import Language.Haskell.GhcMod
import Language.Haskell.GhcMod.Ghc import Language.Haskell.GhcMod.Ghc
import Language.Haskell.GhcMod.Internal
boot :: Options -> Cradle -> IO String bootInfo :: Options -> Cradle -> IO String
boot opt cradle = do bootInfo opt cradle = withGHC' $ do
mods <- listModules opt cradle initializeFlagsWithCradle opt cradle
langs <- listLanguages opt boot opt
flags <- listFlags opt
pre <- concat <$> mapM (browseModule opt cradle) preBrowsedModules
return $ mods ++ langs ++ flags ++ pre
boot' :: Options -> Ghc String boot :: Options -> Ghc String
boot' opt = do boot opt = do
mods <- modules opt mods <- modules opt
langs <- liftIO $ listLanguages opt langs <- liftIO $ listLanguages opt
flags <- liftIO $ listFlags opt flags <- liftIO $ listFlags opt

View File

@ -124,7 +124,7 @@ main = flip E.catches handlers $ do
"lint" -> nArgs 1 withFile (lintSyntax opt) cmdArg1 "lint" -> nArgs 1 withFile (lintSyntax opt) cmdArg1
"root" -> rootInfo opt cradle "root" -> rootInfo opt cradle
"doc" -> nArgs 1 $ packageDoc opt cradle cmdArg1 "doc" -> nArgs 1 $ packageDoc opt cradle cmdArg1
"boot" -> boot opt cradle "boot" -> bootInfo opt cradle
"version" -> return progVersion "version" -> return progVersion
"help" -> return $ O.usageInfo usage argspec "help" -> return $ O.usageInfo usage argspec
cmd -> E.throw (NoSuchCommand cmd) cmd -> E.throw (NoSuchCommand cmd)

View File

@ -261,7 +261,7 @@ bootIt :: Options
-> Set FilePath -> Set FilePath
-> Ghc (String, Bool, Set FilePath) -> Ghc (String, Bool, Set FilePath)
bootIt opt set = do bootIt opt set = do
ret <- boot' opt ret <- boot opt
return (ret, True, set) return (ret, True, set)
browseIt :: Options browseIt :: Options