ghc-mod root does not need a file.
This commit is contained in:
parent
19453e67d7
commit
12dac1f0a5
@ -1,4 +1,4 @@
|
||||
module Language.Haskell.GhcMod.Debug (debugInfo, debug, rootInfo, root) where
|
||||
module Language.Haskell.GhcMod.Debug (debugInfo, debug, rootInfo) where
|
||||
|
||||
import Control.Applicative ((<$>))
|
||||
import Control.Exception.IOChoice ((||>))
|
||||
@ -62,13 +62,5 @@ debug opt cradle fileName = do
|
||||
-- | Obtaining root information.
|
||||
rootInfo :: Options
|
||||
-> Cradle
|
||||
-> FilePath -- ^ A target file.
|
||||
-> IO String
|
||||
rootInfo opt cradle fileName = withGHC fileName (root opt cradle fileName)
|
||||
|
||||
-- | Obtaining root information.
|
||||
root :: Options
|
||||
-> Cradle
|
||||
-> FilePath -- ^ A target file.
|
||||
-> Ghc String
|
||||
root _ cradle _ = return $ cradleRootDir cradle ++ "\n"
|
||||
rootInfo opt cradle = return $ convert opt $ cradleRootDir cradle
|
||||
|
@ -34,7 +34,7 @@ usage = "ghc-mod version " ++ showVersion version ++ "\n"
|
||||
++ "\t ghc-mod info" ++ ghcOptHelp ++ "<HaskellFile> <module> <expression>\n"
|
||||
++ "\t ghc-mod type" ++ ghcOptHelp ++ "<HaskellFile> <module> <line-no> <column-no>\n"
|
||||
++ "\t ghc-mod lint [-h opt] <HaskellFile>\n"
|
||||
++ "\t ghc-mod root <HaskellFile>\n"
|
||||
++ "\t ghc-mod root\n"
|
||||
++ "\t ghc-mod doc <module>\n"
|
||||
++ "\t ghc-mod boot\n"
|
||||
++ "\t ghc-mod help\n"
|
||||
@ -116,7 +116,7 @@ main = flip E.catches handlers $ do
|
||||
"info" -> nArgs 3 infoExpr opt cradle cmdArg1 cmdArg3
|
||||
"type" -> nArgs 4 $ typeExpr opt cradle cmdArg1 (read cmdArg3) (read cmdArg4)
|
||||
"lint" -> nArgs 1 withFile (lintSyntax opt) cmdArg1
|
||||
"root" -> nArgs 1 $ rootInfo opt cradle cmdArg1
|
||||
"root" -> rootInfo opt cradle
|
||||
"doc" -> nArgs 1 $ packageDoc opt cradle cmdArg1
|
||||
"boot" -> do
|
||||
mods <- listModules opt cradle
|
||||
|
Loading…
Reference in New Issue
Block a user