adding options: --package-conf and --no-user-package-conf

These command line options work just like the similar-named GHC flags.
They are useful when working with non-standard package databases.
This commit is contained in:
Takano Akio
2011-05-28 05:43:52 +09:00
parent 92777ed539
commit ad55168265
7 changed files with 55 additions and 32 deletions

View File

@@ -10,7 +10,7 @@ import Types
----------------------------------------------------------------
browseModule :: Options -> String -> IO String
browseModule opt mdlName = convert opt . format <$> browse mdlName
browseModule opt mdlName = convert opt . format <$> browse opt mdlName
where
format
| operators opt = formatOps
@@ -22,9 +22,9 @@ browseModule opt mdlName = convert opt . format <$> browse mdlName
| otherwise = '(' : x ++ ")"
formatOps' [] = error "formatOps'"
browse :: String -> IO [String]
browse mdlName = withGHC $ do
initSession0
browse :: Options -> String -> IO [String]
browse opt mdlName = withGHC $ do
initSession0 opt
maybeNamesToStrings <$> lookupModuleInfo
where
lookupModuleInfo = findModule (mkModuleName mdlName) Nothing >>= getModuleInfo