Commit 5939e7e1 authored by Joachim Breitner's avatar Joachim Breitner
Browse files

With --executable, --internal just adds --ignore-all-exports

parent 778e6739
...@@ -240,6 +240,8 @@ haddock pkg_descr lbi suffixes flags = do ...@@ -240,6 +240,8 @@ haddock pkg_descr lbi suffixes flags = do
let template = showPkg ++ "-haddock-prolog.txt" let template = showPkg ++ "-haddock-prolog.txt"
prolog | null (PD.description pkg_descr) = synopsis pkg_descr prolog | null (PD.description pkg_descr) = synopsis pkg_descr
| otherwise = PD.description pkg_descr | otherwise = PD.description pkg_descr
titleComment | fromFlag (haddockInternal flags) = " (internal documentation)"
| otherwise = ""
withTempFile distPref template $ \prologFileName prologFileHandle -> do withTempFile distPref template $ \prologFileName prologFileHandle -> do
hPutStrLn prologFileHandle prolog hPutStrLn prologFileHandle prolog
hClose prologFileHandle hClose prologFileHandle
...@@ -247,15 +249,18 @@ haddock pkg_descr lbi suffixes flags = do ...@@ -247,15 +249,18 @@ haddock pkg_descr lbi suffixes flags = do
| isVersion2 = srcMainPath : otherModules bi | isVersion2 = srcMainPath : otherModules bi
| otherwise = replaceLitExts inFiles | otherwise = replaceLitExts inFiles
let preprocessDir = buildDir lbi </> exeName exe </> exeName exe ++ "-tmp" let preprocessDir = buildDir lbi </> exeName exe </> exeName exe ++ "-tmp"
let exportsFlags | fromFlag (haddockInternal flags) = ["--ignore-all-exports"]
| otherwise = []
rawSystemProgram verbosity confHaddock rawSystemProgram verbosity confHaddock
([ outputFlag ([ outputFlag
, "--odir=" ++ exeTargetDir , "--odir=" ++ exeTargetDir
, "--title=" ++ exeName exe , "--title=" ++ exeName exe ++ titleComment
, "--prologue=" ++ prologFileName ] , "--prologue=" ++ prologFileName ]
++ linkToHscolour ++ linkToHscolour
++ packageFlags ++ packageFlags
++ programArgs confHaddock ++ programArgs confHaddock
++ verboseFlags ++ verboseFlags
++ exportsFlags
++ haddock2options bi preprocessDir ++ haddock2options bi preprocessDir
++ targets ++ targets
) )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment