[Toybox] [PATCH] Implement man.

Rob Landley rob at landley.net
Fri Apr 26 17:49:18 PDT 2019


On 4/19/19 2:49 PM, makepost at firemail.cc wrote:
> To look up docs on my netbook and server. Practically deroff.1, with
> heuristic for where to put spaces and newlines. How would you simplify
> file resolution and bzcat? What have I got wrong when escaping slashes,
> because while \-\^\- is -- ok, \-\- becomes -\-, e.g. in git-pull.1?

Thank you. It's very nice, and I've merged it.

I also did some cleanup: it knows about .gz and .xz compression now, has -M to
override the man search path (doesn't understand : syntax though), and the help
text is fluffed out a bit. You can now run "make test_man" as a normal user (it
doesn't need to write to /usr/share/man), and the first few tests proves it can
display conflicts (ala man 1 printf vs man 3 printf).

I meant to implement -k next, until I saw this at the end of the tests:

  # TODO: -k
  # TODO: emerge section header newline
  # TODO: fdm not roff
  # TODO: git-pull consecutive escaped slashes

I don't have the domain expertise to understand those last three. Do you have
another patch pending? If not, can you explain what you meant?

I have more changes I want to make to man.c: it should use strstart() to match
and skip in one go (instead of doing it in two functions), I was thinking of
teaching it to wordwrap long lines, "man -k ." is the traditional way to see
what all the man pages on the system are...

Rob



More information about the Toybox mailing list