aboutsummaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 05b71223..e24954de 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -40,6 +40,7 @@ import System.IO
import System.Exit
import System.Environment
import System.FilePath
+import Distribution.Verbosity
#if defined(mingw32_HOST_OS)
import Foreign
@@ -137,6 +138,7 @@ main = handleTopExceptions $ do
args <- getArgs
(flags, fileArgs) <- parseHaddockOpts args
handleEasyFlags flags fileArgs
+ verbosity <- getVerbosity flags
let renderStep packages interfaces = do
updateHTMLXRefs packages
@@ -229,8 +231,6 @@ render flags ifaces installedIfaces = do
,listToMaybe [str | Flag_WikiModuleURL str <- flags]
,listToMaybe [str | Flag_WikiEntityURL str <- flags])
- verbose = Flag_Verbose `elem` flags
-
libdir <- case [str | Flag_Lib str <- flags] of
[] ->
#ifdef IN_GHC_TREE
@@ -356,6 +356,14 @@ getGhcLibDir flags =
xs -> Just $ last xs
+getVerbosity flags =
+ case [ str | Flag_Verbosity str <- flags ] of
+ [] -> return normal
+ x:_ -> case parseVerbosity x of
+ Left e -> throwE e
+ Right v -> return v
+
+
handleEasyFlags flags fileArgs = do
usage <- getUsage