Comment 7 for bug 927028

Revision history for this message
Colin Watson (cjwatson) wrote :

If "nc.openbsd" only appears in the description rather than in the page name, then apropos will show it but whatis won't; that's the essence of the distinction between those two programs. It rather depends what you want, but mostly, apropos is more useful for queries where you can remember a keyword but not exactly what the page is called. It typically produces far too much noise when given a command name, particularly for some of the short ones.

There's actually a bug where apropos never prints "nothing appropriate" even when it couldn't find any matches for an argument, which I noticed and fixed while fixing this bug.

There should be no need to restrict apropos' input. I've fixed this properly for man-db 2.6.2:

Wed Feb 22 03:04:45 GMT 2012 Colin Watson <email address hidden>

        Optimise apropos when given many arguments (Ubuntu bug #927028).

        * src/whatis.c (use_grep, do_whatis, parse_name, parse_whatis,
          do_apropos, search): Operate on multiple pages.
          (use_grep, do_whatis, do_apropos): Update an output array rather
          than returning an int.
          (parse_name, parse_whatis): Update an output array as well as
          returning an int.
          (display, do_whatis_section): Constify page argument.
          (match): Constify lowpage and whatis arguments.
          (main): Process all arguments using a single call to search.
        * NEWS: Document this.

I've yet to work on path resolution in whatis, but that should be easy.