]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
xgettext: Deprecate option '--sort-output'.
authorBruno Haible <bruno@clisp.org>
Sun, 2 Jan 2022 16:40:52 +0000 (17:40 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 2 Jan 2022 16:40:52 +0000 (17:40 +0100)
Suggested by Lauri Nurmi <lanurmi@iki.fi> in
<https://savannah.gnu.org/bugs/?61249>.

* gettext-tools/src/xgettext.c (main): Warn when option '--sort-output' is used.
(usage): Mark the option '--sort-output' deprecated.
* gettext-tools/doc/xgettext.texi: Likewise.
* NEWS: Mention it.

NEWS
gettext-tools/doc/xgettext.texi
gettext-tools/src/xgettext.c

diff --git a/NEWS b/NEWS
index f5ced5bdbef62182e52fd65e9aa2fe3a5b57dd4f..7684c869910ecfc829283ef6de9c3234da4d96fd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,9 @@ Version 0.21.1 - February 2022
 
 * The base Unicode standard is now updated to 14.0.0.
 
+* xgettext:
+  The xgettext option '--sorted-output' is now deprecated.
+
 * Portability:
   - Building on macOS 11/arm64 is now supported.
 
index b2c6374fa6466144d3beacea3923980ae9095e16..7cd9ec8ff8161627d4b908fdcade67676eca2a00 100644 (file)
@@ -1,5 +1,5 @@
 @c This file is part of the GNU gettext manual.
-@c Copyright (C) 1995-2020 Free Software Foundation, Inc.
+@c Copyright (C) 1995-2022 Free Software Foundation, Inc.
 @c See the file gettext.texi for copying conditions.
 
 @pindex xgettext
@@ -537,8 +537,8 @@ lines which are wider than the output page width will be split.
 @opindex -s@r{, @code{xgettext} option}
 @opindex --sort-output@r{, @code{xgettext} option}
 @cindex sorting output of @code{xgettext}
-Generate sorted output.  Note that using this option makes it much harder
-for the translator to understand each message's context.
+Generate sorted output (deprecated).  Note that using this option makes it
+much harder for the translator to understand each message's context.
 
 @item -F
 @itemx --sort-by-file
index e9fb4a0abcca2fd34691c7d82358dc15156ca165..0259f6da5e29539f2ae0c1111c5bcb07279581bf 100644 (file)
@@ -1,5 +1,5 @@
 /* Extracts strings from C source file to Uniforum style .po file.
-   Copyright (C) 1995-1998, 2000-2016, 2018-2021 Free Software Foundation, Inc.
+   Copyright (C) 1995-1998, 2000-2016, 2018-2022 Free Software Foundation, Inc.
    Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, April 1995.
 
    This program is free software: you can redistribute it and/or modify
@@ -742,6 +742,11 @@ xgettext cannot work without keywords to look for"));
     error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
            "--its", "--language");
 
+  /* Warn when deprecated options are used.  */
+  if (sort_by_msgid)
+    error (EXIT_SUCCESS, 0, _("The option '%s' is deprecated."),
+           "--sort-output");
+
   if (explicit_its_filename == NULL)
     {
       its_dirs = get_search_path ("its");
@@ -1211,7 +1216,7 @@ Output details:\n"));
       --no-wrap               do not break long message lines, longer than\n\
                               the output page width, into several lines\n"));
       printf (_("\
-  -s, --sort-output           generate sorted output\n"));
+  -s, --sort-output           generate sorted output (deprecated)\n"));
       printf (_("\
   -F, --sort-by-file          sort output by file location\n"));
       printf (_("\