diff mbox series

[09/10] man: use .TP for lists in xt_osf man page

Message ID 20231026085506.94343-9-jengelh@inai.de
State Superseded
Headers show
Series [01/10] man: display number ranges with an en dash | expand

Commit Message

Jan Engelhardt Oct. 26, 2023, 8:55 a.m. UTC
From: Phil Sutter <phil@nwl.cc>

Value and description are more clearly set apart. Using .RS/.RE
pairs also adds proper indenting.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
---
 extensions/libxt_osf.man | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

Comments

Phil Sutter Oct. 26, 2023, 12:26 p.m. UTC | #1
On Thu, Oct 26, 2023 at 10:55:05AM +0200, Jan Engelhardt wrote:
> From: Phil Sutter <phil@nwl.cc>
> 
> Value and description are more clearly set apart. Using .RS/.RE
> pairs also adds proper indenting.
> 
> Signed-off-by: Jan Engelhardt <jengelh@inai.de>
> ---
>  extensions/libxt_osf.man | 34 ++++++++++++++++++++++------------
>  1 file changed, 22 insertions(+), 12 deletions(-)
> 
> diff --git a/extensions/libxt_osf.man b/extensions/libxt_osf.man
> index 8bd35554..85c1a3b4 100644
> --- a/extensions/libxt_osf.man
> +++ b/extensions/libxt_osf.man
> @@ -8,24 +8,34 @@ Match an operating system genre by using a passive fingerprinting.
>  \fB\-\-ttl\fP \fIlevel\fP
>  Do additional TTL checks on the packet to determine the operating system.
>  \fIlevel\fP can be one of the following values:
> -.IP \(bu 4
> -0 - True IP address and fingerprint TTL comparison. This generally works for
> +.RS
> +.TP
> +\fB0\fP

What is wrong with '.B' here? I assumed it is equivalent to the escapes
(which I don't like for making things unreadable in most cases).

Cheers, Phil
Jan Engelhardt Oct. 26, 2023, 1:42 p.m. UTC | #2
On Thursday 2023-10-26 14:26, Phil Sutter wrote:
>> @@ -8,24 +8,34 @@ Match an operating system genre by using a passive fingerprinting.
>>  \fB\-\-ttl\fP \fIlevel\fP
>>  Do additional TTL checks on the packet to determine the operating system.
>>  \fIlevel\fP can be one of the following values:
>> -.IP \(bu 4
>> -0 - True IP address and fingerprint TTL comparison. This generally works for
>> +.RS
>> +.TP
>> +\fB0\fP
>
>What is wrong with '.B' here? I assumed it is equivalent to the escapes
>(which I don't like for making things unreadable in most cases).

One can make lots of arguments for both sides.

* You cannot mix certain commands. This for example cannot be
  converted to use .B syntax as far as my understanding of roff
  syntax goes:

	.TP
	Some \fBbold\fP keyword
	Explanation what they keyword does

	.TP
	Some
	.B bold
	keyword but oops we are already in the explanation

* Desire for consistent markup across entire documentation;
  since we cannot use .B reliably, \fB offered to take the
  place and so almost all the mantext in iptables uses \fB.

* .B (and commands like it) bloat the line count if you have a lot of
  words to markup, and we certainly do in e.g. the "Synopsis"
  sections.

* \(en could be changed to \[en] or to the Unicode character
  directly. But the groff manpage has ample warnings:

  """these groff extensions are presented using its special character
  form \[]"""

  """Some of these code points are used by groff for internal
  purposes, which is one reason it does not support UTF‐8
  natively."""

  I need to revise the \[-] patch perhaps based on what I just
  learned.

That said, it's 2023. People _should_ be having a syntax-highlighting
editor, and I don't mean it needs to have fancy colors. Just set
escape codes apart (brighten or dimming, whichever is your thing),
e.g. https://paste.opensuse.org/pastes/b593dd7ee4db .
diff mbox series

Patch

diff --git a/extensions/libxt_osf.man b/extensions/libxt_osf.man
index 8bd35554..85c1a3b4 100644
--- a/extensions/libxt_osf.man
+++ b/extensions/libxt_osf.man
@@ -8,24 +8,34 @@  Match an operating system genre by using a passive fingerprinting.
 \fB\-\-ttl\fP \fIlevel\fP
 Do additional TTL checks on the packet to determine the operating system.
 \fIlevel\fP can be one of the following values:
-.IP \(bu 4
-0 - True IP address and fingerprint TTL comparison. This generally works for
+.RS
+.TP
+\fB0\fP
+True IP address and fingerprint TTL comparison. This generally works for
 LANs.
-.IP \(bu 4
-1 - Check if the IP header's TTL is less than the fingerprint one. Works for
+.TP
+\fB1\fP
+Check if the IP header's TTL is less than the fingerprint one. Works for
 globally-routable addresses.
-.IP \(bu 4
-2 - Do not compare the TTL at all.
+.TP
+\fB2\fP
+Do not compare the TTL at all.
+.RE
 .TP
 \fB\-\-log\fP \fIlevel\fP
 Log determined genres into dmesg even if they do not match the desired one.
 \fIlevel\fP can be one of the following values:
-.IP \(bu 4
-0 - Log all matched or unknown signatures
-.IP \(bu 4
-1 - Log only the first one
-.IP \(bu 4
-2 - Log all known matched signatures
+.RS
+.TP
+\fB0\fP
+Log all matched or unknown signatures
+.TP
+\fB1\fP
+Log only the first one
+.TP
+\fB2\fP
+Log all known matched signatures
+.RE
 .PP
 You may find something like this in syslog:
 .PP