Hi,

Sijmen J. Mulder wrote on Thu, Feb 07, 2019 at 09:50:47AM +0100:
> Op 7 feb. 2019 om 08:29 heeft Anne Wainwright het volgende geschreven:

>> I can print out nicely formatted man pages in linux, thus:
>> 
>> $ man -t ls | lpr -P hp_laserjet
>> 
>> But find that the -t option is not present in bsd.
>> 
>> Have really dug around but can find no hints, where should I be looking?

> man supports mandoc's -T option, e.g.:
> 
> man -T ps | ...

That is the correct answer.

But please, if you can, always provide complete, working, tested
command invocations to users, in this case:

  $ man -T ps ls > ls.ps

to generate a PostScript file on disk or

  $ man -T ps ls | lpr

to directly send the same PostScript code to the default printer.

That practice helps to avoid misunderstandings and to promote
good idioms.

> There's a little note about it at the end of the option list in
> man's man page.  See mandoc's man page for the formats and such.

Exactly.  The reason for doing it like that was to keep the man(1)
manual page simple because new users have to read that quite early
when they are not yet experienced.  It would be of dubious benefit
to put lots of rarely-used non-standard options into the man(1)
manual.  Besides, duplicate information is also a problem - both
for maintenance and because it forces readers to scan and compare
two (identical? similar? or subtly different?) versions.

As to why we have mo -t option, see

  http://mandoc.bsd.lv/man/man.options.1.html
  http://mandoc.bsd.lv/man/man.options.1.html#t

Even though it is similar to -T ps in most man(1) implementations,
it has ambiguous meanings in the wider program family, in particular:

 - preprocess with tbl(7) in groff
 - test = check manual pages in the hierarchy with mandb
 - test = check files for problems related to mandoc.db(5) in makewhatis

So i decided it is best to not implement an alias -t, also because
every alias makes the documentation longer, and it is best to get
used to the -T ps option which needs to be supported anyway.

Yours,
  Ingo

Reply via email to