From 54d9edbb47657ba67b5b1c5248f295c772bf2948 Mon Sep 17 00:00:00 2001 From: David Waern Date: Wed, 17 Oct 2007 16:02:28 +0000 Subject: Add --optghc=.. style flag passing to GHC --- src/Haddock/Options.hs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/Haddock/Options.hs') 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" ] -- cgit v1.2.3