]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
msgmerge: Disable --color option in --update mode
authorDaiki Ueno <ueno@gnu.org>
Mon, 9 Jun 2014 04:36:18 +0000 (13:36 +0900)
committerDaiki Ueno <ueno@gnu.org>
Mon, 9 Jun 2014 04:36:18 +0000 (13:36 +0900)
Suggested by 林V字龍 at:
<https://lists.gnu.org/archive/html/bug-gettext/2014-06/msg00017.html>.
* msgmerge.c (main): Error out when --color and --update are
specified at the same time.

gettext-tools/src/ChangeLog
gettext-tools/src/msgmerge.c

index f492e00765151021808c67cf7d7a7b9edd42703e..878d0c5ed572e0af9c9eec1cfa9a8221d58808fb 100644 (file)
@@ -1,3 +1,11 @@
+2014-06-09  Daiki Ueno  <ueno@gnu.org>
+
+       msgmerge: Disable --color option in --update mode
+       Suggested by 林V字龍 at:
+       <https://lists.gnu.org/archive/html/bug-gettext/2014-06/msg00017.html>.
+       * msgmerge.c (main): Error out when --color and --update are
+       specified at the same time.
+
 2014-06-07  Daiki Ueno  <ueno@gnu.org>
 
        xgettext: Fix misrecognition of character literals in C and Vala
index 7c7add986cc0445b6aab7bdde7dff6c4c05e1f18..d8e02ae1060e4850988ec825168ea1d64bccd140 100644 (file)
@@ -172,6 +172,7 @@ main (int argc, char **argv)
   bool do_help;
   bool do_version;
   char *output_file;
+  char *color;
   msgdomain_list_ty *def;
   msgdomain_list_ty *result;
   catalog_input_format_ty input_syntax = &input_format_po;
@@ -203,6 +204,7 @@ main (int argc, char **argv)
   do_help = false;
   do_version = false;
   output_file = NULL;
+  color = NULL;
 
   while ((opt = getopt_long (argc, argv, "C:D:eEFhimn:No:pPqsUvVw:",
                              long_options, NULL))
@@ -330,6 +332,7 @@ main (int argc, char **argv)
       case CHAR_MAX + 9: /* --color */
         if (handle_color_option (optarg) || color_test_mode)
           usage (EXIT_FAILURE);
+        color = optarg;
         break;
 
       case CHAR_MAX + 10: /* --style */
@@ -384,6 +387,16 @@ There is NO WARRANTY, to the extent permitted by law.\n\
           error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
                  "--update", "--output-file");
         }
+      if (color != NULL)
+        {
+          error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
+                 "--update", "--color");
+        }
+      if (style_file_name != NULL)
+        {
+          error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
+                 "--update", "--style");
+        }
     }
   else
     {