林V字龍 <[email protected]> writes: > Since color syntax is not allow in po file we should avoid writing > them in update mode (even the option is wrongly used with --update).
Good idea, thanks. I've pushed a patch to reject --color (and --style) option when --update is used.
>From 29516888a7a2cb6c3d4a23e7c53a6699f2618c84 Mon Sep 17 00:00:00 2001 From: Daiki Ueno <[email protected]> Date: Mon, 9 Jun 2014 13:36:18 +0900 Subject: [PATCH] msgmerge: Disable --color option in --update mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 | 8 ++++++++ gettext-tools/src/msgmerge.c | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index f492e00..878d0c5 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,11 @@ +2014-06-09 Daiki Ueno <[email protected]> + + 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 <[email protected]> xgettext: Fix misrecognition of character literals in C and Vala diff --git a/gettext-tools/src/msgmerge.c b/gettext-tools/src/msgmerge.c index 7c7add9..d8e02ae 100644 --- a/gettext-tools/src/msgmerge.c +++ b/gettext-tools/src/msgmerge.c @@ -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 { -- 1.9.3
Regards, -- Daiki Ueno
