cabal
cabal copied to clipboard
cabal haddock-project suggests --haddock-all but then rejects it
$ cabal haddock-project
Warning: haddock-project command is experimental, it might break in the future
Up to date
No documentation was generated as this package does not contain a library.
Perhaps you want to use the --haddock-all flag, or one or more of the
--haddock-executables, --haddock-tests, --haddock-benchmarks or
--haddock-internal flags.
$ cabal haddock-project --haddock-all
Error: cabal: unrecognized 'haddock-project' option `--haddock-all'
$ cabal --version
cabal-install version 3.10.3.0
compiled using version 3.10.3.0 of the Cabal library
The --haddock-* flags are meant to be used with --haddock-options.
For example this works:
cabal haddock-project --haddock-options="--haddock-all"
The warning message could be a little more clear.
I think this is an inconsistency in the API between haddock and haddock-project.
haddock uses the --haddock-* prefix while haddock-project does not.
This error message is correct for haddock while the help message is correct for haddock-project (#9246).
This command should work:
$ cabal haddock-project --haddock-all
See also: https://github.com/haskell/cabal/blob/315e3f327a615f5d441127bc74a64ced5b77f3f9/cabal-install/src/Distribution/Client/CmdHaddock.hs#L91 and https://github.com/haskell/cabal/blob/315e3f327a615f5d441127bc74a64ced5b77f3f9/cabal-install/src/Distribution/Client/CmdHaddock.hs#L285
I'll add --haddock-all to cabal haddock-project.