From 1cac40b6373fe414b2f75f2c93abccf990d2834b Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Wed, 1 Oct 2025 18:38:21 +0100 Subject: [PATCH] doc: man: consistently italicize --option parameters This changes a few pages, but the changes in tail.1 concisely illustrate the resulting man page changes: $ diff -r man.orig/tail.1 man/tail.1 < \fB\-c\fR, \fB\-\-bytes\fR=\fI\,[\/\fR+]NUM > \fB\-c\fR, \fB\-\-bytes\fR=\fI\,[+]NUM\/\fR < \fB\-f\fR, \fB\-\-follow[=\fR{name|descriptor}] > \fB\-f\fR, \fB\-\-follow\fR[=\fI\,{name|descriptor}\/\fR] < \fB\-n\fR, \fB\-\-lines\fR=\fI\,[\/\fR+]NUM > \fB\-n\fR, \fB\-\-lines\fR=\fI\,[+]NUM\/\fR * man/help2man: Relax the option match so more --option variations are supported, and passed through to convert_option(). Specifically more variations after '=' are now supported. Also split and document the regular expression. Reported at https://github.com/coreutils/coreutils/issues/84 --- man/help2man | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/man/help2man b/man/help2man index 960eebcae2..da03e14da7 100755 --- a/man/help2man +++ b/man/help2man @@ -600,7 +600,12 @@ while (length) unless ($sect eq _('EXAMPLES')) { # Convert options. - s/(^|[ (])(-[][\w=-]+)/$1 . convert_option $2/mge; + s/ + ( + ^|[ (])(-[][\w-]+ # Base -o or --option match + (?:=\S*[^\s,.])? # =parameter portion match + ) + /$1 . convert_option $2/xmge; # Italicise filenames: /a/b, $VAR/c/d, ~/e/f s! -- 2.47.3