From 57e0b8876954fd3e344231dc1046ede0c006f1b9 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Mon, 1 Jul 2024 08:41:17 +0200 Subject: [PATCH] haddock-project: added `--all` switch Added `--all` (`--haddock-all`) switches for compatibility with `haddock` command. `--haddock-all` alias is added, since that's what is suggested by some warning messages. Fixes #10051 --- .../src/Distribution/Simple/Setup/Haddock.hs | 21 +++++++++++++++++++ changelog.d/issue-10051 | 4 ++++ 2 files changed, 25 insertions(+) create mode 100644 changelog.d/issue-10051 diff --git a/Cabal/src/Distribution/Simple/Setup/Haddock.hs b/Cabal/src/Distribution/Simple/Setup/Haddock.hs index e8d7ba54a20..aee2210d907 100644 --- a/Cabal/src/Distribution/Simple/Setup/Haddock.hs +++ b/Cabal/src/Distribution/Simple/Setup/Haddock.hs @@ -584,6 +584,27 @@ haddockProjectOptions _showOrParseArgs = haddockProjectForeignLibs (\v flags -> flags{haddockProjectForeignLibs = v}) trueArg + , option + "" + ["all", "haddock-all"] + "Run haddock for all targets" + ( \f -> + allFlags + [ haddockProjectExecutables f + , haddockProjectTestSuites f + , haddockProjectBenchmarks f + , haddockProjectForeignLibs f + ] + ) + ( \v flags -> + flags + { haddockProjectExecutables = v + , haddockProjectTestSuites = v + , haddockProjectBenchmarks = v + , haddockProjectForeignLibs = v + } + ) + trueArg , option "" ["internal"] diff --git a/changelog.d/issue-10051 b/changelog.d/issue-10051 new file mode 100644 index 00000000000..b582fc2b619 --- /dev/null +++ b/changelog.d/issue-10051 @@ -0,0 +1,4 @@ +synopsis: Added `--all` and `--haddock-all` switches to `haddock-project` subcommand +packages: cabal-install +issues: #10051 +prs: #2272