Ah I see, thanks. I might end up whitelisting sane systems (*BSD) and stupidly predictable ones (macOS), falling back to a JS-based implementation for all other cases. I won't try adding all the bells and whistles that BSD man(1) offers: literally all I need is a *reliable* way to locate *complete* system documentation. Preferably in one fell-swoop; emitting a list of every indexed path saves overhead later on thanks to memoization.
> That is very strange. Given that Solaris is derived from Sys V Unix > (which had it) and from CSRG BSD (which also had it), i have no idea > how they managed to break such a simple option. It gets better (or worse). Here's what Solaris 11.3's `man -k grep` emits: $ ~: man -k grep 1. grep(1) /usr/share/man/man1/grep.1 grep - search a file for a pattern 2. pcregrep(1) /usr/share/man/man1/pcregrep.1 pcregrep - a grep with Perl-compatible regular expressions. 3. gegrep(1) /usr/share/man/man1/gegrep.1 grep, egrep, fgrep - print lines matching a pattern 4. gfgrep(1) /usr/share/man/man1/gfgrep.1 grep, egrep, fgrep - print lines matching a pattern 5. ggrep(1) /usr/share/man/man1/ggrep.1 grep, egrep, fgrep - print lines matching a pattern ... which is probably the closest I've come to finding an equivalent to `man -k` on Solaris.. I blame Oracle. Always blame Oracle. On Sat, 1 Sep 2018 at 21:41, Ingo Schwarze <schwa...@usta.de> wrote: > Hi, > > this likely isn't quite as bad as you seem to fear. > > John Gardner wrote on Wed, Aug 29, 2018 at 11:01:29PM +1000: > > > I should ask, what's the most reliable way of running `man -a -w`? > > I thought this was universal to `man` implementations, > > It is, see > > http://mandoc.bsd.lv/man/man.options.1.html#w > > It has been available since AT&T Unix v7, consequently in BSD since > 3BSD, in Eaton man, man-1.6, man-db, ... - so for practical purposes, > everywhere. > > > but Solaris told me otherwise. > > That is very strange. Given that Solaris is derived from Sys V Unix > (which had it) and from CSRG BSD (which also had it), i have no idea > how they managed to break such a simple option. > > > illumos uses `man -w` to update the `makewhatis` database, > > What a terrible idea. Illumos is derived from Solaris. So probably, > they mistakenly considered the option free because Solaris already > broke it earlier, and reused it for a different purpose, failing > to do the required research first. They should probably fix that > mistake. > > > and this is part of what killed my first attempt at finishing Roff.js. > > I suspect you will get away with using -w if you merely implement > a workaround for Solaris and Solaris-derived systems like Illumos: > if man -w fails, use man -l with a bit of postprocessing instead. > > Of course, do not use -l otherwise: It is wildly non-portable, > and for this purpose, purely a Solaris idiosyncracy: > > http://mandoc.bsd.lv/man/man.options.1.html#l > > Yours, > Ingo >