]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
gettext-runtime: Improve --help output.
authorBruno Haible <bruno@clisp.org>
Wed, 25 Jun 2025 02:15:58 +0000 (04:15 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 25 Jun 2025 02:15:58 +0000 (04:15 +0200)
* gettext-runtime/src/gettext.c (usage): Add section title
"Options and arguments".
* gettext-runtime/src/ngettext.c (usage): Likewise.
* gettext-runtime/doc/rt-gettext.texi: Add section titles
"Options and arguments" and "Informative output".
* gettext-runtime/doc/rt-ngettext.texi: Likewise.

gettext-runtime/doc/rt-gettext.texi
gettext-runtime/doc/rt-ngettext.texi
gettext-runtime/src/gettext.c
gettext-runtime/src/ngettext.c

index dc6a9769302211a6db7b82e2cf34f831cb14b197..f6e50ee74fdc5cca3d0f6ffbb5935c5eb4d05ea8 100644 (file)
@@ -1,5 +1,5 @@
 @c This file is part of the GNU gettext manual.
-@c Copyright (C) 1995-2019 Free Software Foundation, Inc.
+@c Copyright (C) 1995-2025 Free Software Foundation, Inc.
 @c See the file gettext.texi for copying conditions.
 
 @pindex gettext
@@ -13,7 +13,7 @@ gettext [@var{option}] -s [@var{msgid}]...
 The @code{gettext} program displays the native language translation of a
 textual message.
 
-@noindent @strong{Arguments}
+@noindent @strong{Options and arguments}
 
 @table @samp
 @item -c @var{context}
@@ -43,26 +43,31 @@ interpreted like the System V @samp{echo} program did.
 This option is only for compatibility with the @samp{echo} program or shell
 built-in.  It has no effect.
 
+@item -n
+@opindex -n@r{, @code{gettext} option}
+This option has only an effect if the @code{-s} option is given.  It
+suppresses the additional newline at the end.
+
+@item [@var{textdomain}] @var{msgid}
+Retrieve translated message corresponding to @var{msgid} from @var{textdomain}.
+
+@end table
+
+@noindent @strong{Informative output}
+
+@table @samp
 @item -h
 @itemx --help
 @opindex -h@r{, @code{gettext} option}
 @opindex --help@r{, @code{gettext} option}
 Display this help and exit.
 
-@item -n
-@opindex -n@r{, @code{gettext} option}
-This option has only an effect if the @code{-s} option is given.  It
-suppresses the additional newline at the end.
-
 @item -V
 @itemx --version
 @opindex -V@r{, @code{gettext} option}
 @opindex --version@r{, @code{gettext} option}
 Output version information and exit.
 
-@item [@var{textdomain}] @var{msgid}
-Retrieve translated message corresponding to @var{msgid} from @var{textdomain}.
-
 @end table
 
 If the @var{textdomain} parameter is not given, the domain is determined from
index abdcc9adb9ac92e8f852e33de72723f0f425486b..be1fb4beae482f394e3ede6cfa7d78b1a0e848ad 100644 (file)
@@ -1,5 +1,5 @@
 @c This file is part of the GNU gettext manual.
-@c Copyright (C) 1995-2019 Free Software Foundation, Inc.
+@c Copyright (C) 1995-2025 Free Software Foundation, Inc.
 @c See the file gettext.texi for copying conditions.
 
 @pindex ngettext
@@ -12,7 +12,7 @@ ngettext [@var{option}] [@var{textdomain}] @var{msgid} @var{msgid-plural} @var{c
 The @code{ngettext} program displays the native language translation of a
 textual message whose grammatical form depends on a number.
 
-@noindent @strong{Arguments}
+@noindent @strong{Options and arguments}
 
 @table @samp
 @item -c @var{context}
@@ -42,6 +42,20 @@ interpreted like the System V @samp{echo} program did.
 This option is only for compatibility with the @samp{gettext} program.  It has
 no effect.
 
+@item @var{textdomain}
+Retrieve translated message from @var{textdomain}.
+
+@item @var{msgid} @var{msgid-plural}
+Translate @var{msgid} (English singular) / @var{msgid-plural} (English plural).
+
+@item @var{count}
+Choose singular/plural form based on this value.
+
+@end table
+
+@noindent @strong{Informative output}
+
+@table @samp
 @item -h
 @itemx --help
 @opindex -h@r{, @code{ngettext} option}
@@ -54,15 +68,6 @@ Display this help and exit.
 @opindex --version@r{, @code{ngettext} option}
 Output version information and exit.
 
-@item @var{textdomain}
-Retrieve translated message from @var{textdomain}.
-
-@item @var{msgid} @var{msgid-plural}
-Translate @var{msgid} (English singular) / @var{msgid-plural} (English plural).
-
-@item @var{count}
-Choose singular/plural form based on this value.
-
 @end table
 
 If the @var{textdomain} parameter is not given, the domain is determined from
index 6ae28c8ea130a3bbf2331ff9caf77f2d88c140eb..fa39ea892d9b3a87a644346096b0e11d06496b15 100644 (file)
@@ -96,36 +96,36 @@ main (int argc, char *argv[])
   while ((optchar = getopt_long (argc, argv, "+c:d:eEhnsV", long_options, NULL))
          != EOF)
     switch (optchar)
-    {
-    case '\0':          /* Long option.  */
-      break;
-    case 'c':
-      context = optarg;
-      break;
-    case 'd':
-      domain = optarg;
-      break;
-    case 'e':
-      do_expand = true;
-      break;
-    case 'E':
-      /* Ignore.  Just for compatibility.  */
-      break;
-    case 'h':
-      do_help = true;
-      break;
-    case 'n':
-      inhibit_added_newline = true;
-      break;
-    case 's':
-      do_shell = true;
-      break;
-    case 'V':
-      do_version = true;
-      break;
-    default:
-      usage (EXIT_FAILURE);
-    }
+      {
+      case '\0':          /* Long option.  */
+        break;
+      case 'c':
+        context = optarg;
+        break;
+      case 'd':
+        domain = optarg;
+        break;
+      case 'e':
+        do_expand = true;
+        break;
+      case 'E':
+        /* Ignore.  Just for compatibility.  */
+        break;
+      case 'h':
+        do_help = true;
+        break;
+      case 'n':
+        inhibit_added_newline = true;
+        break;
+      case 's':
+        do_shell = true;
+        break;
+      case 'V':
+        do_version = true;
+        break;
+      default:
+        usage (EXIT_FAILURE);
+      }
 
   /* Version information is requested.  */
   if (do_version)
@@ -258,6 +258,8 @@ or:    %s [OPTION] -s [MSGID]...\n\
       printf (_("\
 Display native language translation of a textual message.\n"));
       printf ("\n");
+      printf (_("\
+Options and arguments:\n"));
       /* xgettext: no-wrap */
       printf (_("\
   -d, --domain=TEXTDOMAIN   retrieve translated messages from TEXTDOMAIN\n"));
index 737495e6243160ee11ded91feea696d4c952b0be..43dadad8de37e5ecda0170ed275b8e768e3c5adf 100644 (file)
@@ -93,30 +93,30 @@ main (int argc, char *argv[])
   while ((optchar = getopt_long (argc, argv, "+c:d:eEhV", long_options, NULL))
          != EOF)
     switch (optchar)
-    {
-    case '\0':          /* Long option.  */
-      break;
-    case 'c':
-      context = optarg;
-      break;
-    case 'd':
-      domain = optarg;
-      break;
-    case 'e':
-      do_expand = true;
-      break;
-    case 'E':
-      /* Ignore.  Just for compatibility.  */
-      break;
-    case 'h':
-      do_help = true;
-      break;
-    case 'V':
-      do_version = true;
-      break;
-    default:
-      usage (EXIT_FAILURE);
-    }
+      {
+      case '\0':          /* Long option.  */
+        break;
+      case 'c':
+        context = optarg;
+        break;
+      case 'd':
+        domain = optarg;
+        break;
+      case 'e':
+        do_expand = true;
+        break;
+      case 'E':
+        /* Ignore.  Just for compatibility.  */
+        break;
+      case 'h':
+        do_help = true;
+        break;
+      case 'V':
+        do_version = true;
+        break;
+      default:
+        usage (EXIT_FAILURE);
+      }
 
   /* Version information is requested.  */
   if (do_version)
@@ -226,6 +226,8 @@ Usage: %s [OPTION] [TEXTDOMAIN] MSGID MSGID-PLURAL COUNT\n\
 Display native language translation of a textual message whose grammatical\n\
 form depends on a number.\n"));
       printf ("\n");
+      printf (_("\
+Options and arguments:\n"));
       /* xgettext: no-wrap */
       printf (_("\
   -d, --domain=TEXTDOMAIN   retrieve translated message from TEXTDOMAIN\n"));