Re: syntax of options in man1
"G. Branden Robinson" <[email protected]> Thu, 16 Jul 2026 10:55:44 -0500
| Newsgroups | org.kernel.vger.linux-man |
|---|---|
| Message-ID | <20260716155544.o7fx7ecnpjj5sdai@illithid> |
Hi Alex,
At 2026-07-16T16:45:16+0200, Alejandro Colomar wrote:
> On 2026-07-16T09:46:25-0400, Douglas McIlroy wrote:
> > Here's a typical option heading (from tail(1))
> > * -n, --lines=[+]NUM*
> >
> > It is tempting to assume (incorrectly) that the short alternative is
> > -n=4. As far as I can tell, the convention that "=" is part of only
> > the long alternative is described nowhere.
>
> Agree. I've had that concern for a long time.
That's why I recommend a somewhat different presentation format.
Illustration:
$ cat ATTIC/tail.man
.TH tail 1 2026-07-16 "groff test suite"
.SH Name
tail \- a porcine corkscrew
.SH Description
Print the last 10 lines of each
.I file
to standard output.
.SH Options
.TP
.BR \-\-lines= [ + ]\c
.IR num
.TQ
.BR \-n\~ [ + ]\c
.IR num
Print the last
.I num
lines instead.
.
Prefixing
.I num
with
.RB \[lq] + \[rq]
prints all lines from
.I num
forward.
Rendering:
$ nroff -rLL=72n -P -c -man ATTIC/tail.man
tail(1) General Commands Manual tail(1)
Name
tail - a porcine corkscrew
Description
Print the last 10 lines of each file to standard output.
Options
--lines=[+]num
-n [+]num
Print the last num lines instead. Prefixing num with “+”
prints all lines from num forward.
groff test suite 2026‐07‐16 tail(1)
Regards,
Branden
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmpY/vgACgkQ0Z6cfXEm bc5S2w/+OxKExRDwlrTC0EspLkNy2A9wJoqJinrr+v/PZqehlOWb6GoRwBN/mdpO meK+dOINiuzevg1ntAR9YngYkldPzZpHPVwISHW5jUr+KllPtNJiIQ9eP7XMOebk SpudGClpjjwcoWvU2B9JYKThJisKjg/yppqTn8/+vSSE15sMAOCVb+F6N/9O47Xc WOxbXUaNwvrjgG4HyXpM0lrbH9MbdoYyBNDStELUpxD+Fv9pPTxdc+arYFYaUEhM K8aMmveFdr7sSKtQVJFLW9vC/3Og9a5+GEDjZN1rXWshaG/vNmh8l5RMw65UllSA YdR359Jbw4s3Ip8SdTua5KyzyC04MrFr2w3ZNwDOVAoMdx7/uq4rYDC6lvR1B2Bm 6HeKA4qwZktolmkdLLPgJoBMyuq3giEkUBZ6flWly1z87Us07mEFNKBGb5Z6wzx0 cU8pMdkvN9IxUDe0A011j1HSMmYgzHZa2I4wO0je5XL+OIAKN0gyVytpSbm9ApCf VTSdJ5BgU8Q18BqiDh5xIiouqwvtMy/T8Zxk2yDdVb3NepTeaNl2TNFAg9qTkb5j Q5LAYTiM1N8IL3YwdcnpuvWXJuQD6tEAN9XOPAh7HLTSfyfLZImSjjayVt5Iyqhi 28tm/1PTlBdLIQBq6ZcfFPhq08sD65NVl2Ey0p1AUx2fA2WNL1w= =i6dL -----END PGP SIGNATURE-----