From: Benno Schulenberg Date: Mon, 6 Oct 2025 00:24:41 +0000 (-0400) Subject: swapon: rename the new --annotation option to --annotate X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=53e247a28d666f12982b31fba0c0101372d0803d;p=thirdparty%2Futil-linux.git swapon: rename the new --annotation option to --annotate 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 --- diff --git a/bash-completion/swapon b/bash-completion/swapon index d94d2234d..5906ec844 100644 --- a/bash-completion/swapon +++ b/bash-completion/swapon @@ -56,7 +56,7 @@ _swapon_module() case $cur in -*) OPTS="--all - --annotation + --annotate --discard --ifexists --fixpgsz diff --git a/lib/strutils.c b/lib/strutils.c index e4dabf212..a3b1376e3 100644 --- a/lib/strutils.c +++ b/lib/strutils.c @@ -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); } /* diff --git a/man-common/annotation.adoc b/man-common/annotation.adoc index 8f9d4c879..f97d1d9b1 100644 --- a/man-common/annotation.adoc +++ b/man-common/annotation.adoc @@ -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. diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c index 896728880..fc5351e21 100644 --- a/sys-utils/swapon.c +++ b/sys-utils/swapon.c @@ -840,7 +840,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -T, --fstab alternative file to /etc/fstab\n"), out); fputs(_(" --show[=] display summary in definable table\n"), out); fputs(_(" --output-all output all available columns\n"), out); - fputs(_(" --annotation[=] annotate columns with a tooltip (always|never|auto)\n"), out); + fputs(_(" --annotate[=] 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 },