
| > Suppose ghc --full-flag-help simply printed the URL | > http://www.haskell.org/ghc/docs/latest/html/users_guide/flag-reference.html | > Now you can see it in your web browser by clicking on it.
Indeed, the installed version would be much better
it would indeed be kind of nice if ghc (perhaps via ghc-pkg??) knew if and where its documentation was installed. but i consult the locally installed users' guide quite as often on other topics than flags, and usually have several ghcs installed, and some ghc installations appear to come without, or with partial html docs (for whatever reason), and i have at least one editor-script (*) that needs to figure out where the html docs are for the ghc in $PATH (that editor-script did indeed start out as a convenient way to get at the GHC and library docs while editing Haskell code in VIM, and currently tries to guess the docdir from the libdir, which won't work in general). so, how about (in analogy to --print-libdir): ghc --print-docdir c:/ghc/ghc-6.6/doc/html or whereever the local docs are rooted, if there are local docs, and ghc --print-docdir http://www.haskell.org/ghc/docs/6.6/html/ if there are no local docs installed (note the paths to version-specific docs). currently, adding "/users_guide/flag-reference.html" to the result would lead to the appropriate section for flags, which could be done by a simple wrapper, and i'd find --print-docdir more generally useful. claus (*) Doc.vim (finding haddocks, auto-completing names, adding imports; for VIM) http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/Vim/Doc.vim