Re: mandoc.1: update example to reflect current options

2022-02-08 Thread Ingo Schwarze
Hello Anders,

Anders Damsgaard wrote on Tue, Feb 08, 2022 at 08:36:11AM +0100:

> The mandoc(1) option alias -l for -a was removed from the documentation
> in revision 1.107:
> 
> https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/mandoc/mandoc.1.diff?r1=1.106=1.107
> 
> The -l option still works, but this diff makes the example consistent
> with the current option description.

Thanks, committed.

Both are correct and reliable, but i agree -a is easier to understand
whereas understanding why -l works is a bit convoluted.

Yours,
  Ingo



Log message:
In the first example, use "mandoc -a" directly rather "mandoc -l".

It feels more natural to me to use -a directly when asking mandoc(1)
to use a pager.  The reason that "mandoc -l" does exactly the same
as "mandoc -a" is that "mandoc" is essentially "man -lc", so the -a
implied by -l negates the -c and the -l has no effect because it is
already the default for mandoc(1).

The more usual command for doing the same is "man -l foo.1 bar.1 ..."
but that's off-topic for the mandoc(1) manual page.

Patch on tech@ from Anders Damsgaard .


> Index: usr.bin/mandoc/mandoc.1
> ===
> RCS file: /cvs/src/usr.bin/mandoc/mandoc.1,v
> retrieving revision 1.180
> diff -u -p -u -p -r1.180 mandoc.1
> --- usr.bin/mandoc/mandoc.1   6 Feb 2022 00:29:03 -   1.180
> +++ usr.bin/mandoc/mandoc.1   8 Feb 2022 07:33:42 -
> @@ -735,7 +735,7 @@ output mode implies
>   .Sh EXAMPLES
>   To page manuals to the terminal:
>   .Pp
> -.Dl $ mandoc -l mandoc.1 man.1 apropos.1 makewhatis.8
> +.Dl $ mandoc -a mandoc.1 man.1 apropos.1 makewhatis.8
>   .Pp
>   To produce HTML manuals with
>   .Pa /usr/share/misc/mandoc.css



mandoc.1: update example to reflect current options

2022-02-08 Thread Anders Damsgaard

Hello,

The mandoc(1) option alias -l for -a was removed from the documentation
in revision 1.107:

https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/mandoc/mandoc.1.diff?r1=1.106=1.107

The -l option still works, but this diff makes the example consistent
with the current option description.

Cheers, Anders


Index: usr.bin/mandoc/mandoc.1
===
RCS file: /cvs/src/usr.bin/mandoc/mandoc.1,v
retrieving revision 1.180
diff -u -p -u -p -r1.180 mandoc.1
--- usr.bin/mandoc/mandoc.1 6 Feb 2022 00:29:03 -   1.180
+++ usr.bin/mandoc/mandoc.1 8 Feb 2022 07:33:42 -
@@ -735,7 +735,7 @@ output mode implies
 .Sh EXAMPLES
 To page manuals to the terminal:
 .Pp
-.Dl $ mandoc -l mandoc.1 man.1 apropos.1 makewhatis.8
+.Dl $ mandoc -a mandoc.1 man.1 apropos.1 makewhatis.8
 .Pp
 To produce HTML manuals with
 .Pa /usr/share/misc/mandoc.css