]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Restructure usage message. Tweak command line options.
authorBruno Haible <bruno@clisp.org>
Mon, 30 Apr 2001 13:55:56 +0000 (13:55 +0000)
committerBruno Haible <bruno@clisp.org>
Mon, 30 Apr 2001 13:55:56 +0000 (13:55 +0000)
src/ChangeLog
src/msgcmp.c
src/msgcomm.c
src/msgfmt.c
src/msgmerge.c
src/msgunfmt.c
src/xgettext.c

index 1ee21d92d490600acee4af89b1fcb5d4252e1028..c20d09e9e5917d9dcb08533e5bb572fc5b3399d4 100644 (file)
@@ -1,3 +1,26 @@
+2001-04-28  Bruno Haible  <haible@clisp.cons.org>
+
+       * msgcmp.c (usage): Restructure usage message. Talk about ref.pot, not
+       ref.po.
+       * msgcomm.c (long_options): Remove --add-comments, --join-existing
+       options.
+       (main): Rename local variables sort_output, sort_by_file to
+       sort_by_msgid, sort_by_filepos. Remove -c and -j options.
+       (usage): Restructure usage message. INPUTFILE is not mandatory. Remove
+       --trigraphs option.
+       * msgfmt.c (usage): Restructure usage message.
+       * msgmerge.c (main): Signal error if both --sort-output and
+       --sort-by-file were given.
+       (usage): Restructure usage message. Talk about ref.pot, not ref.po.
+       Document --sort-output, --sort-by-file, --quiet.
+       * msgunfmt.c (long_options): Add --sort-output.
+       (main): Recognize -s/--sort-output option, and sort the message list
+       when it is given.
+       (usage): Restructure usage message.
+       * xgettext.c (main): Rename local variables sort_output, sort_by_file
+       to sort_by_msgid, sort_by_filepos.
+       (usage): Restructure usage message.
+
 2001-04-28  Bruno Haible  <haible@clisp.cons.org>
 
        * po-charset.h: New file.
index e6fed4d003734952ad848805d00877762d9d0363..24f39efe198c0cbabf3003c94b2ec68fc4737fe0 100644 (file)
@@ -180,19 +180,34 @@ usage (status)
     {
       /* xgettext: no-wrap */
       printf (_("\
-Usage: %s [OPTION] def.po ref.po\n\
+Usage: %s [OPTION] def.po ref.pot\n\
+"), program_name);
+      /* xgettext: no-wrap */
+      printf (_("\
+Compare two Uniforum style .po files to check that both contain the same\n\
+set of msgid strings.  The def.po file is an existing PO file with the\n\
+translations.  The ref.pot file is the last created PO file, or a PO Template\n\
+file (generally created by xgettext).  This is useful for checking that\n\
+you have translated each and every message in your program.  Where an exact\n\
+match cannot be found, fuzzy matching is used to produce better diagnostics.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
 Mandatory arguments to long options are mandatory for short options too.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Input file location:\n\
+  def.po                      translations\n\
+  ref.pot                     references to the sources\n\
   -D, --directory=DIRECTORY   add DIRECTORY to list for input files search\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Informative output:\n\
   -h, --help                  display this help and exit\n\
   -V, --version               output version information and exit\n\
-\n\
-Compare two Uniforum style .po files to check that both contain the same\n\
-set of msgid strings.  The def.po file is an existing PO file with the\n\
-old translations.  The ref.po file is the last created PO file\n\
-(generally by xgettext).  This is useful for checking that you have\n\
-translated each and every message in your program.  Where an exact match\n\
-cannot be found, fuzzy matching is used to produce better diagnostics.\n"),
-             program_name);
+\n"));
       fputs (_("Report bugs to <bug-gnu-utils@gnu.org>.\n"), stdout);
     }
 
index 28b1aed5c29fafa4c90a4f58a200caeb3fe7d5c1..2ad355a8a346199551755c0ff02446d56c89792b 100644 (file)
@@ -76,7 +76,6 @@ static int less_than = -1;
 /* Long options.  */
 static const struct option long_options[] =
 {
-  { "add-comments", optional_argument, NULL, 'c' },
   { "add-location", no_argument, &line_comment, 1 },
   { "default-domain", required_argument, NULL, 'd' },
   { "directory", required_argument, NULL, 'D' },
@@ -85,7 +84,6 @@ static const struct option long_options[] =
   { "force-po", no_argument, &force_po, 1 },
   { "help", no_argument, NULL, 'h' },
   { "indent", no_argument, NULL, 'i' },
-  { "join-existing", no_argument, NULL, 'j' },
   { "no-escape", no_argument, NULL, 'e' },
   { "no-location", no_argument, &line_comment, 0 },
   { "omit-header", no_argument, &omit_header, 1 },
@@ -138,8 +136,8 @@ main (argc, argv)
   int do_help = 0;
   int do_version = 0;
   message_list_ty *mlp;
-  int sort_output = 0;
-  int sort_by_file = 0;
+  int sort_by_msgid = 0;
+  int sort_by_filepos = 0;
   char *file_name;
   const char *files_from = NULL;
   string_list_ty *file_list;
@@ -163,7 +161,7 @@ main (argc, argv)
   default_domain = MESSAGE_DOMAIN_DEFAULT;
 
   while ((optchar = getopt_long (argc, argv,
-                                "<:>:ac::Cd:D:eEf:Fhijk::l:L:m::M::no:p:sTuVw:x:",
+                                "<:>:aCd:D:eEf:Fhik::l:L:m::M::no:p:sTuVw:x:",
                                 long_options, NULL)) != EOF)
     switch (optchar)
       {
@@ -203,7 +201,7 @@ main (argc, argv)
        files_from = optarg;
        break;
       case 'F':
-       sort_by_file = 1;
+       sort_by_filepos = 1;
         break;
       case 'h':
        do_help = 1;
@@ -237,7 +235,7 @@ main (argc, argv)
        }
        break;
       case 's':
-       sort_output = 1;
+       sort_by_msgid = 1;
        break;
       case 'S':
        message_print_style_uniforum ();
@@ -263,11 +261,11 @@ main (argc, argv)
       }
 
   /* Verify selected options.  */
-  if (!line_comment && sort_by_file)
+  if (!line_comment && sort_by_filepos)
     error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
           "--no-location", "--sort-by-file");
 
-  if (sort_output && sort_by_file)
+  if (sort_by_msgid && sort_by_filepos)
     error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
           "--sort-output", "--sort-by-file");
 
@@ -317,7 +315,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
   for (cnt = optind; cnt < argc; ++cnt)
     string_list_append_unique (file_list, argv[cnt]);
 
-  /* Test whether sufficient input files weregiven.  */
+  /* Test whether sufficient input files were given.  */
   if (file_list->nitems < 2)
     {
       error (EXIT_SUCCESS, 0, _("at least two files must be specified"));
@@ -356,9 +354,9 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
     }
 
   /* Sorting the list of messages.  */
-  if (sort_by_file)
+  if (sort_by_filepos)
     message_list_sort_by_filepos (mlp);
-  else if (sort_output)
+  else if (sort_by_msgid)
     message_list_sort_by_msgid (mlp);
 
   /* Write the PO file.  */
@@ -380,47 +378,71 @@ usage (status)
     {
       /* xgettext: no-wrap */
       printf (_("\
-Usage: %s [OPTION] INPUTFILE ...\n\
+Usage: %s [OPTION] [INPUTFILE]...\n\
+"), program_name);
+      /* xgettext: no-wrap */
+      printf (_("\
+Find messages which are common to two or more of the specified PO files.\n\
+By using the --more-than option, greater commonality may be requested\n\
+before messages are printed.  Conversely, the --less-than option may be\n\
+used to specify less commonality before messages are printed (i.e.\n\
+--less-than=2 will only print the unique messages).  Translations,\n\
+comments and extract comments will be preserved, but only from the first\n\
+PO file to define them.  File positions from all PO files will be\n\
+cumulated.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
 Mandatory arguments to long options are mandatory for short options too.\n\
-  -d, --default-domain=NAME      use NAME.po for output (instead of messages.po)\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Input file location:\n\
+  INPUTFILE ...                  input files\n\
+  -f, --files-from=FILE          get list of input files from FILE\n\
   -D, --directory=DIRECTORY      add DIRECTORY to list for input files search\n\
+If input file is -, standard input is read.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Output file location:\n\
+  -d, --default-domain=NAME      use NAME.po for output (instead of messages.po)\n\
+  -o, --output=FILE              write output to specified file\n\
+  -p, --output-dir=DIR           output files will be placed in directory DIR\n\
+If output file is -, output is written to standard output.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Message selection:\n\
+  -<, --less-than=NUMBER         print messages with less than this many\n\
+                                 definitions, defaults to infinite if not\n\
+                                 set\n\
+  ->, --more-than=NUMBER         print messages with more than this many\n\
+                                 definitions, defaults to 1 if not set\n\
+  -u, --unique                   shorthand for --less-than=2, requests\n\
+                                 that only unique messages be printed\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Output details:\n\
   -e, --no-escape                do not use C escapes in output (default)\n\
   -E, --escape                   use C escapes in output, no extended chars\n\
-  -f, --files-from=FILE          get list of input files from FILE\n\
       --force-po                 write PO file even if empty\n\
-  -F, --sort-by-file             sort output by file location\n\
-  -h, --help                     display this help and exit\n"),
-             program_name);
-      fputs (_("\
   -i, --indent                   write the .po file using indented style\n\
       --no-location              do not write '#: filename:line' lines\n\
   -n, --add-location             generate '#: filename:line' lines (default)\n\
-      --omit-header              don't write header with `msgid \"\"' entry\n\
-  -o, --output=FILE              write output to specified file\n\
-  -p, --output-dir=DIR           output files will be placed in directory DIR\n\
-  -s, --sort-output              generate sorted output and remove duplicates\n\
       --strict                   write out strict Uniforum conforming .po file\n\
-  -T, --trigraphs                understand ANSI C trigraphs for input\n\
-  -u, --unique                   shorthand for --less-than=2, requests\n\
-                                 that only unique messages be printed\n"),
-            stdout);
-      fputs (_("\
-  -V, --version                  output version information and exit\n\
   -w, --width=NUMBER             set output page width\n\
-  -<, --less-than=NUMBER         print messages with less than this many\n\
-                                 definitions, defaults to infinite if not\n\
-                                 set\n\
-  ->, --more-than=NUMBER         print messages with more than this many\n\
-                                 definitions, defaults to 1 if not set\n\
-\n\
-Find messages which are common to two or more of the specified PO files.\n\
-By using the --more-than option, greater commonality may be requested\n\
-before messages are printed.  Conversely, the --less-than option may be\n\
-used to specify less commonality before messages are printed (i.e.\n\
---less-than=2 will only print the unique messages).  Translations,\n\
-comments and extract comments will be preserved, but only from the first\n\
-PO file to define them.  File positions from all PO files will be\n\
-preserved.\n"), stdout);
+  -s, --sort-output              generate sorted output and remove duplicates\n\
+  -F, --sort-by-file             sort output by file location\n\
+      --omit-header              don't write header with `msgid \"\"' entry\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Informative output:\n\
+  -h, --help                     display this help and exit\n\
+  -V, --version                  output version information and exit\n\
+\n"));
       fputs (_("Report bugs to <bug-gnu-utils@gnu.org>.\n"),
             stdout);
     }
index e0f3138151805aae2f61a023656bca2296d5d53e..a26b42a4b6440b431b9d72cc7bcdcec8f2a604df 100644 (file)
@@ -286,7 +286,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
       usage (EXIT_FAILURE);
     }
 
-  /* The -o option determines the name of the domain and therefor
+  /* The -o option determines the name of the domain and therefore
      the output file.  */
   if (output_file_name != NULL)
     current_domain = new_domain (output_file_name);
@@ -390,26 +390,50 @@ usage (status)
       /* xgettext: no-wrap */
       printf (_("\
 Usage: %s [OPTION] filename.po ...\n\
+"), program_name);
+      /* xgettext: no-wrap */
+      printf (_("\
 Generate binary message catalog from textual translation description.\n\
-\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
 Mandatory arguments to long options are mandatory for short options too.\n\
-  -a, --alignment=NUMBER      align strings to NUMBER bytes (default: %d)\n\
-  -c, --check                 perform language dependent checks on strings\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Input file location:\n\
+  filename.po ...             input files\n\
   -D, --directory=DIRECTORY   add DIRECTORY to list for input files search\n\
+If input file is -, standard input is read.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Output file location:\n\
+  -o, --output-file=FILE      write output to specified file\n\
+      --strict                enable strict Uniforum mode\n\
+If output file is -, output is written to standard output.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Input file interpretation:\n\
+  -c, --check                 perform language dependent checks on strings\n\
   -f, --use-fuzzy             use fuzzy entries in output\n\
-  -h, --help                  display this help and exit\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Output details:\n\
+  -a, --alignment=NUMBER      align strings to NUMBER bytes (default: %d)\n\
       --no-hash               binary file will not include the hash table\n\
-  -o, --output-file=FILE      specify output file name as FILE\n\
+\n"), DEFAULT_OUTPUT_ALIGNMENT);
+      /* xgettext: no-wrap */
+      printf (_("\
+Informative output:\n\
+  -h, --help                  display this help and exit\n\
+  -V, --version               output version information and exit\n\
       --statistics            print statistics about translations\n\
-      --strict                enable strict Uniforum mode\n\
   -v, --verbose               list input file anomalies\n\
-  -V, --version               output version information and exit\n\
-\n\
 Giving the -v option more than once increases the verbosity level.\n\
-\n\
-If input file is -, standard input is read.  If output file is -,\n\
-output is written to standard output.\n"),
-             program_name, DEFAULT_OUTPUT_ALIGNMENT);
+\n"));
       fputs (_("Report bugs to <bug-gnu-utils@gnu.org>.\n"), stdout);
     }
 
index 1d56ff154dfb66da1294a8a00d7a083766f9548b..13c10cdcfcee4da8a6d86e6587e8939d94a8a9a6 100644 (file)
@@ -277,6 +277,10 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
       usage (EXIT_FAILURE);
     }
 
+  if (sort_by_msgid && sort_by_filepos)
+    error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
+           "--sort-output", "--sort-by-file");
+
   /* merge the two files */
   result = merge (argv[optind], argv[optind + 1]);
 
@@ -318,35 +322,62 @@ usage (status)
     {
       /* xgettext: no-wrap */
       printf (_("\
-Usage: %s [OPTION] def.po ref.po\n\
+Usage: %s [OPTION] def.po ref.pot\n\
+"), program_name);
+      /* xgettext: no-wrap */
+      printf (_("\
+Merges two Uniforum style .po files together.  The def.po file is an\n\
+existing PO file with translations which will be taken over to the newly\n\
+created file as long as they still match; comments will be preserved,\n\
+but extracted comments and file positions will be discarded.  The ref.pot\n\
+file is the last created PO file with up-to-date source references but\n\
+old translations, or a PO Template file (generally created by xgettext);\n\
+any translations or comments in the file will be discarded, however dot\n\
+comments and file positions will be preserved.  Where an exact match\n\
+cannot be found, fuzzy matching is used to produce better results.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
 Mandatory arguments to long options are mandatory for short options too.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Input file location:\n\
+  def.po                      translations referring to old sources\n\
+  ref.pot                     references to new sources\n\
+  -D, --directory=DIRECTORY   add DIRECTORY to list for input files search\n\
   -C, --compendium=FILE       additional library of message translations,\n\
                               may be specified more than once\n\
-  -D, --directory=DIRECTORY   add DIRECTORY to list for input files search\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Output file location:\n\
+  -o, --output-file=FILE      write output to specified file\n\
+The results are written to standard output if no output file is specified\n\
+or if it is -.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Output details:\n\
   -e, --no-escape             do not use C escapes in output (default)\n\
   -E, --escape                use C escapes in output, no extended chars\n\
       --force-po              write PO file even if empty\n\
-  -h, --help                  display this help and exit\n\
   -i, --indent                indented output style\n\
-  -o, --output-file=FILE      result will be written to FILE\n\
       --no-location           suppress '#: filename:line' lines\n\
       --add-location          preserve '#: filename:line' lines (default)\n\
       --strict                strict Uniforum output style\n\
-  -v, --verbose               increase verbosity level\n\
-  -V, --version               output version information and exit\n\
-  -w, --width=NUMBER          set output page width\n"),
-               program_name);
+  -w, --width=NUMBER          set output page width\n\
+  -s, --sort-output           generate sorted output and remove duplicates\n\
+  -F, --sort-by-file          sort output by file location\n\
+\n"));
       /* xgettext: no-wrap */
-      fputs (_("\n\
-Merges two Uniforum style .po files together.  The def.po file is an\n\
-existing PO file with the old translations which will be taken over to\n\
-the newly created file as long as they still match; comments will be\n\
-preserved, but extract comments and file positions will be discarded.\n\
-The ref.po file is the last created PO file (generally by xgettext), any\n\
-translations or comments in the file will be discarded, however dot\n\
-comments and file positions will be preserved.  Where an exact match\n\
-cannot be found, fuzzy matching is used to produce better results.  The\n\
-results are written to stdout unless an output file is specified.\n"), stdout);
+      printf (_("\
+Informative output:\n\
+  -h, --help                  display this help and exit\n\
+  -V, --version               output version information and exit\n\
+  -v, --verbose               increase verbosity level\n\
+  -q, --quiet, --silent       suppress progress indicators\n\
+\n"));
       fputs (_("Report bugs to <bug-gnu-utils@gnu.org>.\n"),
             stdout);
     }
index 3cfd7f0e2bc7ee44e4ea533babebdeda4f341abb..fbb581733a08de9688a842492e7ab5cb963077c0 100644 (file)
@@ -63,6 +63,7 @@ static const struct option long_options[] =
   { "indent", no_argument, NULL, 'i' },
   { "no-escape", no_argument, NULL, 'e' },
   { "output-file", required_argument, NULL, 'o' },
+  { "sort-output", no_argument, NULL, 's' },
   { "strict", no_argument, NULL, 'S' },
   { "version", no_argument, NULL, 'V' },
   { "width", required_argument, NULL, 'w', },
@@ -96,6 +97,7 @@ main (argc, argv)
   int do_version = 0;
   const char *output_file = "-";
   message_list_ty *mlp = NULL;
+  int sort_by_msgid = 0;
 
   /* Set program name for messages.  */
   program_name = argv[0];
@@ -110,7 +112,7 @@ main (argc, argv)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
-  while ((optchar = getopt_long (argc, argv, "eEhio:Vw:", long_options, NULL))
+  while ((optchar = getopt_long (argc, argv, "eEhio:sVw:", long_options, NULL))
         != EOF)
     switch (optchar)
       {
@@ -138,6 +140,10 @@ main (argc, argv)
        output_file = optarg;
        break;
 
+      case 's':
+       sort_by_msgid = 1;
+       break;
+
       case 'S':
        message_print_style_uniforum ();
        break;
@@ -187,6 +193,10 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
   else
     mlp = read_mo_file (NULL, "-");
 
+  /* Sorting the list of messages.  */
+  if (sort_by_msgid)
+    message_list_sort_by_msgid (mlp);
+
   /* Write the resulting message list to the given .po file.  */
   message_list_print (mlp, output_file, force_po, 0);
 
@@ -208,23 +218,45 @@ usage (status)
       /* xgettext: no-wrap */
       printf (_("\
 Usage: %s [OPTION] [FILE]...\n\
+"), program_name);
+      /* xgettext: no-wrap */
+      printf (_("\
+Convert binary message catalog to Uniforum style .po file.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
 Mandatory arguments to long options are mandatory for short options too.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Input file location:\n\
+  FILE ...                 input .mo files\n\
+If no input file is given or if it is -, standard input is read.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Output file location:\n\
+  -o, --output-file=FILE   write output to specified file\n\
+The results are written to standard output if no output file is specified\n\
+or if it is -.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Output details:\n\
   -e, --no-escape          do not use C escapes in output (default)\n\
   -E, --escape             use C escapes in output, no extended chars\n\
       --force-po           write PO file even if empty\n\
-  -h, --help               display this help and exit\n\
   -i, --indent             write indented output style\n\
-  -o, --output-file=FILE   write output into FILE instead of standard output\n\
       --strict             write strict uniforum style\n\
-  -V, --version            output version information and exit\n\
-  -w, --width=NUMBER       set output page width\n"),
-             program_name);
+  -w, --width=NUMBER       set output page width\n\
+  -s, --sort-output        generate sorted output and remove duplicates\n\
+\n"));
       /* xgettext: no-wrap */
-      fputs (_("\n\
-Convert binary .mo files to Uniforum style .po files.\n\
-Both little-endian and big-endian .mo files are handled.\n\
-If no input file is given or it is -, standard input is read.\n\
-By default the output is written to standard output.\n"), stdout);
+      printf (_("\
+Informative output:\n\
+  -h, --help               display this help and exit\n\
+  -V, --version            output version information and exit\n\
+\n"));
       fputs (_("Report bugs to <bug-gnu-utils@gnu.org>.\n"),
             stdout);
     }
index d40c6ce5efb9ec47a1df3b14c031dd9cc75a95de..231db94ca997590a6d5c9ffa2ea74f71a7e6ef2d 100644 (file)
@@ -205,8 +205,8 @@ main (argc, argv)
   int do_version = 0;
   message_list_ty *mlp;
   int join_existing = 0;
-  int sort_output = 0;
-  int sort_by_file = 0;
+  int sort_by_msgid = 0;
+  int sort_by_filepos = 0;
   char *file_name;
   const char *files_from = NULL;
   string_list_ty *file_list;
@@ -274,7 +274,7 @@ main (argc, argv)
        files_from = optarg;
        break;
       case 'F':
-       sort_by_file = 1;
+       sort_by_filepos = 1;
         break;
       case 'h':
        do_help = 1;
@@ -329,7 +329,7 @@ main (argc, argv)
        }
        break;
       case 's':
-       sort_output = 1;
+       sort_by_msgid = 1;
        break;
       case 'S':
        message_print_style_uniforum ();
@@ -361,11 +361,11 @@ main (argc, argv)
   if (omit_header != 0 && line_comment < 0)
     line_comment = 0;
 
-  if (!line_comment && sort_by_file)
+  if (!line_comment && sort_by_filepos)
     error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
           "--no-location", "--sort-by-file");
 
-  if (sort_output && sort_by_file)
+  if (sort_by_msgid && sort_by_filepos)
     error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
           "--sort-output", "--sort-by-file");
 
@@ -445,7 +445,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
   /* Generate a header, so that we know how and when this PO file was
      created.  */
   if (!omit_header)
-      message_list_append (mlp, construct_header ());
+    message_list_append (mlp, construct_header ());
 
   /* Read in the old messages, so that we can add to them.  */
   if (join_existing)
@@ -494,9 +494,9 @@ warning: file `%s' extension `%s' is unknown; will try C"), fname, extension);
   string_list_free (file_list);
 
   /* Sorting the list of messages.  */
-  if (sort_by_file)
+  if (sort_by_filepos)
     message_list_sort_by_filepos (mlp);
-  else if (sort_output)
+  else if (sort_by_msgid)
     message_list_sort_by_msgid (mlp);
 
   /* Write the PO file.  */
@@ -518,50 +518,81 @@ usage (status)
     {
       /* xgettext: no-wrap */
       printf (_("\
-Usage: %s [OPTION] INPUTFILE ...\n\
+Usage: %s [OPTION] [INPUTFILE]...\n\
+"), program_name);
+      /* xgettext: no-wrap */
+      printf (_("\
 Extract translatable string from given input files.\n\
-\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
 Mandatory arguments to long options are mandatory for short options too.\n\
-  -a, --extract-all              extract all strings\n\
+Similarly for optional arguments.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Input file location:\n\
+  INPUTFILE ...                  input files\n\
+  -f, --files-from=FILE          get list of input files from FILE\n\
+  -D, --directory=DIRECTORY      add DIRECTORY to list for input files search\n\
+If input file is -, standard input is read.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Output file location:\n\
+  -d, --default-domain=NAME      use NAME.po for output (instead of messages.po)\n\
+  -o, --output=FILE              write output to specified file\n\
+  -p, --output-dir=DIR           output files will be placed in directory DIR\n\
+If output file is -, output is written to standard output.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Choice of input file language:\n\
+  -L, --language=NAME            recognise the specified language (C, C++, PO)\n\
+  -C, --c++                      shorthand for --language=C++\n\
+By default the language is guessed depending on the input file name extension.\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Operation mode:\n\
+  -j, --join-existing            join messages with existing file\n\
+  -x, --exclude-file=FILE.po     entries from FILE.po are not extracted\n\
   -c, --add-comments[=TAG]       place comment block with TAG (or those\n\
                                  preceding keyword lines) in output file\n\
-  -C, --c++                      shorthand for --language=C++\n\
-      --debug                    more detailed formatstring recognision result\n\
-  -d, --default-domain=NAME      use NAME.po for output (instead of messages.po)\n\
-  -D, --directory=DIRECTORY      add DIRECTORY to list for input files search\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Language=C/C++ specific options:\n\
+  -a, --extract-all              extract all strings\n\
+  -k, --keyword[=WORD]           additional keyword to be looked for (without\n\
+                                 WORD means not to use default keywords)\n\
+  -T, --trigraphs                understand ANSI C trigraphs for input\n\
+      --debug                    more detailed formatstring recognition result\n\
+\n"));
+      /* xgettext: no-wrap */
+      printf (_("\
+Output details:\n\
   -e, --no-escape                do not use C escapes in output (default)\n\
   -E, --escape                   use C escapes in output, no extended chars\n\
-  -f, --files-from=FILE          get list of input files from FILE\n\
       --force-po                 write PO file even if empty\n\
-      --foreign-user             omit FSF copyright in output for foreign user\n\
-  -F, --sort-by-file             sort output by file location\n"),
-             program_name);
-      /* xgettext: no-wrap */
-      printf (_("\
-  -h, --help                     display this help and exit\n\
   -i, --indent                   write the .po file using indented style\n\
-  -j, --join-existing            join messages with existing file\n\
-  -k, --keyword[=WORD]           additonal keyword to be looked for (without\n\
-                                 WORD means not to use default keywords)\n\
-  -L, --language=NAME            recognise the specified language (C, C++, PO),\n\
-                                 otherwise is guessed from file extension\n\
+      --no-location              do not write '#: filename:line' lines\n\
+  -n, --add-location             generate '#: filename:line' lines (default)\n\
+      --strict                   write out strict Uniforum conforming .po file\n\
+  -w, --width=NUMBER             set output page width\n\
+  -s, --sort-output              generate sorted output and remove duplicates\n\
+  -F, --sort-by-file             sort output by file location\n\
+      --omit-header              don't write header with `msgid \"\"' entry\n\
+      --foreign-user             omit FSF copyright in output for foreign user\n\
   -m, --msgstr-prefix[=STRING]   use STRING or \"\" as prefix for msgstr entries\n\
   -M, --msgstr-suffix[=STRING]   use STRING or \"\" as suffix for msgstr entries\n\
-      --no-location              do not write '#: filename:line' lines\n"));
+\n"));
       /* xgettext: no-wrap */
-      fputs (_("\
-  -n, --add-location             generate '#: filename:line' lines (default)\n\
-      --omit-header              don't write header with `msgid \"\"' entry\n\
-  -o, --output=FILE              write output to specified file\n\
-  -p, --output-dir=DIR           output files will be placed in directory DIR\n\
-  -s, --sort-output              generate sorted output and remove duplicates\n\
-      --strict                   write out strict Uniforum conforming .po file\n\
-  -T, --trigraphs                understand ANSI C trigraphs for input\n\
+      printf (_("\
+Informative output:\n\
+  -h, --help                     display this help and exit\n\
   -V, --version                  output version information and exit\n\
-  -w, --width=NUMBER             set output page width\n\
-  -x, --exclude-file=FILE        entries from FILE are not extracted\n\
-\n\
-If INPUTFILE is -, standard input is read.\n"), stdout);
+\n"));
       fputs (_("Report bugs to <bug-gnu-utils@gnu.org>.\n"),
             stdout);
     }