From 095244c2d8e8ba19344afc16f7a188f1ab7fb2e6 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Tue, 24 May 2022 22:57:03 +0200 Subject: [PATCH] Added support for hoogle for the haddock-project command --- Cabal/src/Distribution/Simple/Setup.hs | 7 +++++++ cabal-install/src/Distribution/Client/CmdHaddockProject.hs | 1 + 2 files changed, 8 insertions(+) diff --git a/Cabal/src/Distribution/Simple/Setup.hs b/Cabal/src/Distribution/Simple/Setup.hs index d5d710286..072979739 100644 --- a/Cabal/src/Distribution/Simple/Setup.hs +++ b/Cabal/src/Distribution/Simple/Setup.hs @@ -1590,6 +1590,7 @@ data HaddockProjectFlags = HaddockProjectFlags { haddockProjectProgramPaths :: [(String, FilePath)], haddockProjectProgramArgs :: [(String, [String])], + haddockProjectHoogle :: Flag Bool, -- haddockHtml is not supported -- haddockForHackage is not supported haddockProjectExecutables :: Flag Bool, @@ -1620,6 +1621,7 @@ defaultHaddockProjectFlags = HaddockProjectFlags { haddockProjectTestSuites = Flag False, haddockProjectProgramPaths = mempty, haddockProjectProgramArgs = mempty, + haddockProjectHoogle = Flag False, haddockProjectExecutables = Flag False, haddockProjectBenchmarks = Flag False, haddockProjectForeignLibs = Flag False, @@ -1682,6 +1684,11 @@ haddockProjectOptions _showOrParseArgs = haddockProjectGenContents (\v flags -> flags { haddockProjectGenContents = v}) trueArg + ,option "" ["hoogle"] + "Generate a hoogle database" + haddockProjectHoogle (\v flags -> flags { haddockProjectHoogle = v }) + trueArg + ,option "" ["executables"] "Run haddock for Executables targets" haddockProjectExecutables (\v flags -> flags { haddockProjectExecutables = v }) diff --git a/cabal-install/src/Distribution/Client/CmdHaddockProject.hs b/cabal-install/src/Distribution/Client/CmdHaddockProject.hs index 8eb858791..761f29f11 100644 --- a/cabal-install/src/Distribution/Client/CmdHaddockProject.hs +++ b/cabal-install/src/Distribution/Client/CmdHaddockProject.hs @@ -80,6 +80,7 @@ haddockProjectAction flags _extraArgs globalFlags = do , haddockBaseUrl = Flag ".." , haddockProgramPaths = haddockProjectProgramPaths flags , haddockProgramArgs = haddockProjectProgramArgs flags + , haddockHoogle = haddockProjectHoogle flags , haddockExecutables = haddockProjectExecutables flags , haddockTestSuites = haddockProjectTestSuites flags , haddockBenchmarks = haddockProjectBenchmarks flags -- 2.11.4.GIT