aboutsummaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2008-12-07 19:58:53 +0000
committerDavid Waern <david.waern@gmail.com>2008-12-07 19:58:53 +0000
commit302651f5b7182061f0459d71cf3e17189bf2ca64 (patch)
treeb97cb96e5054405f9918aad75ad1053e857b4fe4 /src/Main.hs
parent3144024f2b768749b29f16a744dee6028577f0bf (diff)
Add verbosity flag and utils, remove "verbose" flag
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