]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: man: consistently italicize --option parameters
authorPádraig Brady <P@draigBrady.com>
Wed, 1 Oct 2025 17:38:21 +0000 (18:38 +0100)
committerPádraig Brady <P@draigBrady.com>
Thu, 2 Oct 2025 09:13:53 +0000 (10:13 +0100)
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

index 960eebcae24218c25b4dde62afc94bdcb7a4fd68..da03e14da729e762e73f8495e5337a04c88588a4 100755 (executable)
@@ -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!