aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Options.hs
diff options
context:
space:
mode:
authorDavid Waern <davve@dtek.chalmers.se>2007-10-17 16:02:28 +0000
committerDavid Waern <davve@dtek.chalmers.se>2007-10-17 16:02:28 +0000
commit54d9edbb47657ba67b5b1c5248f295c772bf2948 (patch)
treefa9748b5e4be17caf9ddee153eeec4316de6fc24 /src/Haddock/Options.hs
parent0f578158c1745bd98f940c2124c3463055a400b6 (diff)
Add --optghc=.. style flag passing to GHC
Diffstat (limited to 'src/Haddock/Options.hs')
-rw-r--r--src/Haddock/Options.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Haddock/Options.hs b/src/Haddock/Options.hs
index c330f35e..89850f9c 100644
--- a/src/Haddock/Options.hs
+++ b/src/Haddock/Options.hs
@@ -8,7 +8,8 @@
module Haddock.Options (
parseHaddockOpts,
Flag(..),
- getUsage
+ getUsage,
+ makeGhcFlags
) where
@@ -35,6 +36,10 @@ parseHaddockOpts words =
throwE (concat errors ++ usage)
+makeGhcFlags :: [Flag] -> [String]
+makeGhcFlags flags = [ option | Flag_OptGhc option <- flags ]
+
+
data Flag
= Flag_CSS String
| Flag_Debug
@@ -64,7 +69,7 @@ data Flag
| Flag_IgnoreAllExports
| Flag_HideModule String
| Flag_UsePackage String
- | Flag_GhcFlag String
+ | Flag_OptGhc String
| Flag_GhcLibDir String
deriving (Eq)
@@ -131,6 +136,6 @@ options backwardsCompat =
"behave as if MODULE has the hide attribute",
Option [] ["use-package"] (ReqArg Flag_UsePackage "PACKAGE")
"the modules being processed depend on PACKAGE",
- Option ['g'] [] (ReqArg Flag_GhcFlag "FLAGS + ARGS")
- ("send a flag to GHC")
+ Option [] ["optghc"] (ReqArg Flag_OptGhc "OPTION")
+ "Forward option to GHC"
]