aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Options.hs
diff options
context:
space:
mode:
authorDavid Waern <davve@dtek.chalmers.se>2007-10-18 22:03:20 +0000
committerDavid Waern <davve@dtek.chalmers.se>2007-10-18 22:03:20 +0000
commit3fdfcf2a507667327fc6b0e1c95cc9898fc1f9b6 (patch)
treec04142ff36153395424558d12540f9162654a8e3 /src/Haddock/Options.hs
parent54d9edbb47657ba67b5b1c5248f295c772bf2948 (diff)
Add support for --read-interface again
Diffstat (limited to 'src/Haddock/Options.hs')
-rw-r--r--src/Haddock/Options.hs21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/Haddock/Options.hs b/src/Haddock/Options.hs
index 89850f9c..152b30d4 100644
--- a/src/Haddock/Options.hs
+++ b/src/Haddock/Options.hs
@@ -9,7 +9,8 @@ module Haddock.Options (
parseHaddockOpts,
Flag(..),
getUsage,
- makeGhcFlags
+ getGhcFlags,
+ getIfacePairs
) where
@@ -36,14 +37,26 @@ parseHaddockOpts words =
throwE (concat errors ++ usage)
-makeGhcFlags :: [Flag] -> [String]
-makeGhcFlags flags = [ option | Flag_OptGhc option <- flags ]
+getGhcFlags :: [Flag] -> [String]
+getGhcFlags flags = [ option | Flag_OptGhc option <- flags ]
+
+
+getIfacePairs :: [Flag] -> [(FilePath, FilePath)]
+getIfacePairs flags = [ parseIfaceOption s | Flag_ReadInterface s <- flags ]
+
+
+parseIfaceOption :: String -> (FilePath, FilePath)
+parseIfaceOption s =
+ case break (==',') s of
+ (fpath,',':file) -> (fpath, file)
+ (file, _) -> ("", file)
data Flag
= Flag_CSS String
| Flag_Debug
-- | Flag_DocBook
+ | Flag_ReadInterface String
| Flag_DumpInterface String
| Flag_Heading String
| Flag_Html
@@ -83,6 +96,8 @@ options backwardsCompat =
"directory in which to put the output files",
Option ['l'] ["lib"] (ReqArg Flag_Lib "DIR")
"location of Haddock's auxiliary files",
+ Option ['i'] ["read-interface"] (ReqArg Flag_ReadInterface "FILE")
+ "read an interface from FILE",
Option ['D'] ["dump-interface"] (ReqArg Flag_DumpInterface "FILE")
"interface file name",
-- Option ['S'] ["docbook"] (NoArg Flag_DocBook)