]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
swapon: rename the new --annotation option to --annotate
authorBenno Schulenberg <bensberg@telfort.nl>
Mon, 6 Oct 2025 00:24:41 +0000 (20:24 -0400)
committerChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Mon, 6 Oct 2025 00:25:22 +0000 (20:25 -0400)
The form --annotation gave the impression that after the subsequent
"=" comes the text that each column name should be annotated with.
Furthermore, the other two options with optional arguments (--show
and --discard) are in the imperative, so follow that style and use
--annotate instead.

(In the bargain, this allows aligning the descriptions in the help
text perfectly again.)

Also, improve the description of --annotate in the man page somewhat.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
bash-completion/swapon
lib/strutils.c
man-common/annotation.adoc
sys-utils/swapon.c

index d94d2234db7c958e1d6322f4839f6d0302844c70..5906ec8445f54225104a74ad8e7014c397fb141a 100644 (file)
@@ -56,7 +56,7 @@ _swapon_module()
        case $cur in
                -*)
                        OPTS="--all
-                               --annotation
+                               --annotate
                                --discard
                                --ifexists
                                --fixpgsz
index e4dabf21208b348bb53619bdb8d4e030d27fb9c5..a3b1376e34b57e2ba86743e876c60beea8a97f6b 100644 (file)
@@ -562,7 +562,7 @@ bool annotationwanted(const char *mode)
        if (!mode || strcmp(mode, "auto") == 0)
                return isatty(STDOUT_FILENO) ? true : false;
 
-       errx(EXIT_FAILURE, _("invalid argument of --annotation: %s"), mode);
+       errx(EXIT_FAILURE, _("invalid argument of --annotate: %s"), mode);
 }
 
 /*
index 8f9d4c8795cc7155409ba938aa9433a8277826cc..f97d1d9b187acea5f24665d86758b952256c6b60 100644 (file)
@@ -1,6 +1,6 @@
-*--annotation*[**=**_when_]::
-Adds an annotation to column header names which can be printed as a
-tooltip by supporting terminals. The optional _when_ argument can be
-*always*, *never*, or *auto*. If the argument is omitted, it defaults to
+*--annotate*[**=**_when_]::
+Adds an annotation to each column header name. Such an annotation can be shown
+as a tooltip by terminals that support this feature. The optional _when_ argument
+can be *always*, *never*, or *auto*. If the argument is omitted, it defaults to
 *auto*, which means that annotations will only be used when the output
 goes to a terminal.
index 89672888030619b42774187c2d56da754451c546..fc5351e216d97f41b6445413d2813f1562d29ec5 100644 (file)
@@ -840,7 +840,7 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" -T, --fstab <path>       alternative file to /etc/fstab\n"), out);
        fputs(_("     --show[=<columns>]   display summary in definable table\n"), out);
        fputs(_("     --output-all         output all available columns\n"), out);
-       fputs(_("     --annotation[=<when>]  annotate columns with a tooltip (always|never|auto)\n"), out);
+       fputs(_("     --annotate[=<when>]  annotate columns with a tooltip (always|never|auto)\n"), out);
        fputs(_("     --noheadings         don't print table heading (with --show)\n"), out);
        fputs(_("     --raw                use the raw output format (with --show)\n"), out);
        fputs(_("     --bytes              display swap size in bytes in --show output\n"), out);
@@ -900,7 +900,7 @@ int main(int argc, char *argv[])
                { "version",      no_argument,       NULL, 'V'                 },
                { "show",         optional_argument, NULL, SHOW_OPTION         },
                { "output-all",   no_argument,       NULL, OPT_LIST_TYPES      },
-               { "annotation",   optional_argument, NULL, ANNOTATION_OPTION   },
+               { "annotate",     optional_argument, NULL, ANNOTATION_OPTION   },
                { "noheadings",   no_argument,       NULL, NOHEADINGS_OPTION   },
                { "raw",          no_argument,       NULL, RAW_OPTION          },
                { "bytes",        no_argument,       NULL, BYTES_OPTION        },