commercialhaskell / stack

The Haskell Tool Stack
http://haskellstack.org
BSD 3-Clause "New" or "Revised" License
3.99k stars 844 forks source link

--hoogle can't be added to stack haddock command #3447

Open marklnichols opened 7 years ago

marklnichols commented 7 years ago

When I try to run:
stack haddock --haddock-arguments=--hoogle I get the error:
"haddock: --hoogle cannot be used with --gen-index or --gen-contents"
I can see that these additional parameters have been added by stack before the actual command is executed:
...haddock.EXE --hoogle --gen-contents --gen-index....

Is there a work-around for this? (Stack version 1.5.1)

decentral1se commented 7 years ago

Oof, looks like a bug to me.

mgsloan commented 7 years ago

I don't think this is a bug. I don't understand the vagaries of haddock's --hoogle flag, but it just always fails when used with --gen-contents / --gen-index. It has nothing to do with being before or after anything, argument order does not matter here.

You probably want to just use stack hoogle, perhaps stack hoogle --rebuild

marklnichols commented 7 years ago

I guess the issue is: should --gen-contents and --gen-index be added implicitly without any way to turn them off?

decentral1se commented 7 years ago

@marklnichols, yes, what I was thinking as well. As it stands now, you simply cannot pass the --hoogle argument, regardless of whether or not it breaks all the time. We should add an option override these default arguments?