]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
New options --color, --style for many programs.
authorBruno Haible <bruno@clisp.org>
Sat, 13 Mar 2010 14:04:10 +0000 (15:04 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 13 Mar 2010 14:04:37 +0000 (15:04 +0100)
26 files changed:
ChangeLog
NEWS
gettext-tools/doc/ChangeLog
gettext-tools/doc/msgattrib.texi
gettext-tools/doc/msgcomm.texi
gettext-tools/doc/msgconv.texi
gettext-tools/doc/msgen.texi
gettext-tools/doc/msgfilter.texi
gettext-tools/doc/msggrep.texi
gettext-tools/doc/msginit.texi
gettext-tools/doc/msgmerge.texi
gettext-tools/doc/msgunfmt.texi
gettext-tools/doc/msguniq.texi
gettext-tools/doc/xgettext.texi
gettext-tools/src/ChangeLog
gettext-tools/src/msgattrib.c
gettext-tools/src/msgcomm.c
gettext-tools/src/msgconv.c
gettext-tools/src/msgen.c
gettext-tools/src/msgfilter.c
gettext-tools/src/msggrep.c
gettext-tools/src/msginit.c
gettext-tools/src/msgmerge.c
gettext-tools/src/msgunfmt.c
gettext-tools/src/msguniq.c
gettext-tools/src/xgettext.c

index ac640e75a8a2be21626d02a7211431575046cc59..e7e65ede8452d56bd020d8251e86f84001a96087 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-03-13  Bruno Haible  <bruno@clisp.org>
+
+       * NEWS: Mention the --color and --style options on many programs.
+
 2010-01-19  Bruno Haible  <bruno@clisp.org>
 
        * AUTHORS: Update from fencepost.gnu.org:/gd/gnuorg/copyright.list.
diff --git a/NEWS b/NEWS
index 57344469c8e00e79888d8617096a23ad9ddf1ad3..1d3a4e07073392c996c17b80c795e4bc8884214c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,11 @@ Version 0.18 - January 2008
   to the message.  Translators can produce better translations when they know
   that the numeric argument is small.
 
+* Colorized PO files:
+  msgattrib, msgcomm, msgconv, msgen, msgfilter, msggrep, msginit, msgmerge,
+  msgunfmt, msguniq, xgettext now have options --color and --style, like msgcat
+  has since version 0.17.
+
 * msgmerge is up to 10 times faster when the PO and POT files are large.
   This speedup was contributed by Ralf Wildenhues.
 
index 133d0dd080a5a3e5adbf7fddaea5caaa0be6583d..6105b937d18776614ea316d89fe1dd31799c2099 100644 (file)
@@ -1,3 +1,20 @@
+2010-03-13  Bruno Haible  <bruno@clisp.org>
+
+       New options --color, --style for many programs.
+       * msgattrib.texi: Document the options --color and --style.
+       * msgcomm.texi: Likewise.
+       * msgconv.texi: Likewise.
+       * msgen.texi: Likewise.
+       * msgfilter.texi: Likewise.
+       * msggrep.texi: Likewise.
+       * msginit.texi: Likewise.
+       * msgmerge.texi: Likewise.
+       * msgunfmt.texi: Likewise.
+       * msguniq.texi: Likewise.
+       * xgettext.texi: Likewise.
+       Reported by Kalle Olavi Niemitalo <kon@iki.fi>
+       via Santiago Vila <sanvila@unex.es>.
+
 2010-02-20  Bruno Haible  <bruno@clisp.org>
 
        * gettext.texi (Plural forms): Add Bulgarian.
index 596d6184f6b3b37cef153bced8b7c2b48fc26b97..39fe7eebd59227f0dea9cf8f7027ad4121e17b25 100644 (file)
@@ -177,6 +177,17 @@ Assume the input file is a NeXTstep/GNUstep localized resource file in
 @c --no-escape and --escape omitted on purpose.  They are not useful.
 
 @table @samp
+@item --color
+@itemx --color=@var{when}
+@opindex --color@r{, @code{msgattrib} option}
+Specify whether or when to use colors and other text attributes.
+See @ref{The --color option} for details.
+
+@item --style=@var{style_file}
+@opindex --style@r{, @code{msgattrib} option}
+Specify the CSS style rule file to use for @code{--color}.
+See @ref{The --style option} for details.
+
 @item --force-po
 @opindex --force-po@r{, @code{msgattrib} option}
 Always write an output file even if it contains no message.
index cff0c90a3a939fa294d1c2eae1e8189beb381a37..72e0aad990b0bbcef0523345ee1440c05bcdd1f4 100644 (file)
@@ -102,6 +102,17 @@ Assume the input files are NeXTstep/GNUstep localized resource files in
 @c --no-escape and --escape omitted on purpose.  They are not useful.
 
 @table @samp
+@item --color
+@itemx --color=@var{when}
+@opindex --color@r{, @code{msgcomm} option}
+Specify whether or when to use colors and other text attributes.
+See @ref{The --color option} for details.
+
+@item --style=@var{style_file}
+@opindex --style@r{, @code{msgcomm} option}
+Specify the CSS style rule file to use for @code{--color}.
+See @ref{The --style option} for details.
+
 @item --force-po
 @opindex --force-po@r{, @code{msgcomm} option}
 Always write an output file even if it contains no message.
index c5f53f6eeef298a1cbb57252e0284c4b79d58216..6e58fd23ef14861cce75aaf10208649776f9b20d 100644 (file)
@@ -75,6 +75,17 @@ Assume the input file is a NeXTstep/GNUstep localized resource file in
 @c --no-escape and --escape omitted on purpose.  They are not useful.
 
 @table @samp
+@item --color
+@itemx --color=@var{when}
+@opindex --color@r{, @code{msgconv} option}
+Specify whether or when to use colors and other text attributes.
+See @ref{The --color option} for details.
+
+@item --style=@var{style_file}
+@opindex --style@r{, @code{msgconv} option}
+Specify the CSS style rule file to use for @code{--color}.
+See @ref{The --style option} for details.
+
 @item --force-po
 @opindex --force-po@r{, @code{msgconv} option}
 Always write an output file even if it contains no message.
index 6686c8393496782d0a8acdde9c3bbabe41a331b0..f45444be586de5bb413efb35209dc4b5ec5162ff 100644 (file)
@@ -75,6 +75,17 @@ Specify the @samp{Language} field to be used in the header entry.  See
 @samp{Language-Team} and @samp{Plural-Forms} fields are not set by this
 option.
 
+@item --color
+@itemx --color=@var{when}
+@opindex --color@r{, @code{msgen} option}
+Specify whether or when to use colors and other text attributes.
+See @ref{The --color option} for details.
+
+@item --style=@var{style_file}
+@opindex --style@r{, @code{msgen} option}
+Specify the CSS style rule file to use for @code{--color}.
+See @ref{The --style option} for details.
+
 @item --force-po
 @opindex --force-po@r{, @code{msgen} option}
 Always write an output file even if it contains no message.
index 736373d6b87ab63db5b23976ab13aa7d65b54848..05c3fb883dbd1bab2dbc860c4f7713ef7423cb61 100644 (file)
@@ -143,6 +143,17 @@ Assume the input file is a NeXTstep/GNUstep localized resource file in
 @c --no-escape and --escape omitted on purpose.  They are not useful.
 
 @table @samp
+@item --color
+@itemx --color=@var{when}
+@opindex --color@r{, @code{msgfilter} option}
+Specify whether or when to use colors and other text attributes.
+See @ref{The --color option} for details.
+
+@item --style=@var{style_file}
+@opindex --style@r{, @code{msgfilter} option}
+Specify the CSS style rule file to use for @code{--color}.
+See @ref{The --style option} for details.
+
 @item --force-po
 @opindex --force-po@r{, @code{msgfilter} option}
 Always write an output file even if it contains no message.
index c2adebc17fea5698f8f86e931b9c037e4acb670f..31bc81591af8db923a6a4be9faab4841ea52c743 100644 (file)
@@ -177,6 +177,17 @@ Assume the input file is a NeXTstep/GNUstep localized resource file in
 @c --no-escape and --escape omitted on purpose.  They are not useful.
 
 @table @samp
+@item --color
+@itemx --color=@var{when}
+@opindex --color@r{, @code{msggrep} option}
+Specify whether or when to use colors and other text attributes.
+See @ref{The --color option} for details.
+
+@item --style=@var{style_file}
+@opindex --style@r{, @code{msggrep} option}
+Specify the CSS style rule file to use for @code{--color}.
+See @ref{The --style option} for details.
+
 @item --force-po
 @opindex --force-po@r{, @code{msggrep} option}
 Always write an output file even if it contains no message.
index 5b0f5253580184357a1bab37211a4ff16b2f4069..889887df0042486e43e2f8aeff06ea2fed5984f3 100644 (file)
@@ -71,6 +71,17 @@ of all installed locales.  The default is the user's locale setting.
 Declares that the PO file will not have a human translator and is instead
 automatically generated.
 
+@item --color
+@itemx --color=@var{when}
+@opindex --color@r{, @code{msginit} option}
+Specify whether or when to use colors and other text attributes.
+See @ref{The --color option} for details.
+
+@item --style=@var{style_file}
+@opindex --style@r{, @code{msginit} option}
+Specify the CSS style rule file to use for @code{--color}.
+See @ref{The --style option} for details.
+
 @item -p
 @itemx --properties-output
 @opindex -p@r{, @code{msginit} option}
index e924d4f99a39abfbb5d6cc26923162584a533cf4..481694157b414cb1def0be44fba903347a81f692 100644 (file)
@@ -163,6 +163,17 @@ Specify the @samp{Language} field to be used in the header entry.  See
 If this option is not specified, the @samp{Language} field is inferred, as
 best as possible, from the @samp{Language-Team} field.
 
+@item --color
+@itemx --color=@var{when}
+@opindex --color@r{, @code{msgmerge} option}
+Specify whether or when to use colors and other text attributes.
+See @ref{The --color option} for details.
+
+@item --style=@var{style_file}
+@opindex --style@r{, @code{msgmerge} option}
+Specify the CSS style rule file to use for @code{--color}.
+See @ref{The --style option} for details.
+
 @item --force-po
 @opindex --force-po@r{, @code{msgmerge} option}
 Always write an output file even if it contains no message.
index 6b710cc579881b9041bf21d608b98186d5a7041c..ed85f816ae2cc968a8bf1b33fb5b17a6997b605f 100644 (file)
@@ -131,6 +131,17 @@ or if it is @samp{-}.
 @c --no-escape and --escape omitted on purpose.  They are not useful.
 
 @table @samp
+@item --color
+@itemx --color=@var{when}
+@opindex --color@r{, @code{msgunfmt} option}
+Specify whether or when to use colors and other text attributes.
+See @ref{The --color option} for details.
+
+@item --style=@var{style_file}
+@opindex --style@r{, @code{msgunfmt} option}
+Specify the CSS style rule file to use for @code{--color}.
+See @ref{The --style option} for details.
+
 @item --force-po
 @opindex --force-po@r{, @code{msgunfmt} option}
 Always write an output file even if it contains no message.
index 43bb4823635cb3b905d92eadb49fe56f74da1c9b..120a8fec20e4092fa1966f9216906cdc965acd14 100644 (file)
@@ -99,6 +99,17 @@ Specify encoding for output.
 Use first available translation for each message.  Don't merge several
 translations into one.
 
+@item --color
+@itemx --color=@var{when}
+@opindex --color@r{, @code{msguniq} option}
+Specify whether or when to use colors and other text attributes.
+See @ref{The --color option} for details.
+
+@item --style=@var{style_file}
+@opindex --style@r{, @code{msguniq} option}
+Specify the CSS style rule file to use for @code{--color}.
+See @ref{The --style option} for details.
+
 @item --force-po
 @opindex --force-po@r{, @code{msguniq} option}
 Always write an output file even if it contains no message.
index 263dbc8cb9c9a8871de72198481c1b92f7085dcc..bc7e633e0770e9857945c3008f22d31221e65e03 100644 (file)
@@ -351,6 +351,17 @@ adjacent strings, and escaped end of lines for continued strings.
 @c --no-escape and --escape omitted on purpose.  They are not useful.
 
 @table @samp
+@item --color
+@itemx --color=@var{when}
+@opindex --color@r{, @code{xgettext} option}
+Specify whether or when to use colors and other text attributes.
+See @ref{The --color option} for details.
+
+@item --style=@var{style_file}
+@opindex --style@r{, @code{xgettext} option}
+Specify the CSS style rule file to use for @code{--color}.
+See @ref{The --style option} for details.
+
 @item --force-po
 @opindex --force-po@r{, @code{xgettext} option}
 Always write an output file even if no message is defined.
index 325c2db407b089c6de95d946cba9dddd38eb1e24..327e7d12572eb5d99369eda021a4f80c67f03985 100644 (file)
@@ -1,3 +1,53 @@
+2010-03-13  Bruno Haible  <bruno@clisp.org>
+
+       New options --color, --style for many programs.
+       * msgattrib.c: Include color.h.
+       (long_options): Add options --color, --style.
+       (main): Implement them.
+       (usage): Document them.
+       * msgcomm.c: Include color.h.
+       (long_options): Add options --color, --style.
+       (main): Implement them.
+       (usage): Document them.
+       * msgconv.c: Include color.h.
+       (long_options): Add options --color, --style.
+       (main): Implement them.
+       (usage): Document them.
+       * msgen.c: Include color.h.
+       (long_options): Add options --color, --style.
+       (main): Implement them.
+       (usage): Document them.
+       * msgfilter.c: Include color.h.
+       (long_options): Add options --color, --style.
+       (main): Implement them.
+       (usage): Document them.
+       * msggrep.c: Include color.h.
+       (long_options): Add options --color, --style.
+       (main): Implement them.
+       (usage): Document them.
+       * msginit.c: Include color.h.
+       (long_options): Add options --color, --style.
+       (main): Implement them.
+       (usage): Document them.
+       * msgmerge.c: Include color.h.
+       (long_options): Add options --color, --style.
+       (main): Implement them.
+       (usage): Document them.
+       * msgunfmt.c: Include color.h.
+       (long_options): Add options --color, --style.
+       (main): Implement them.
+       (usage): Document them.
+       * msguniq.c: Include color.h.
+       (long_options): Add options --color, --style.
+       (main): Implement them.
+       (usage): Document them.
+       * xgettext.c: Include color.h.
+       (long_options): Add options --color, --style.
+       (main): Implement them.
+       (usage): Document them.
+       Reported by Kalle Olavi Niemitalo <kon@iki.fi>
+       via Santiago Vila <sanvila@unex.es>.
+
 2010-02-20  Bruno Haible  <bruno@clisp.org>
 
        * plural-table.c (plural_table): Add Bulgarian.
index d5c8d40d63994bd0760a5d81b6a4364035f3f0fe..73b7942d1c8f7ff6f76c9c46ceead0cbc22ee14b 100644 (file)
@@ -1,5 +1,5 @@
 /* Manipulates attributes of messages in translation catalogs.
-   Copyright (C) 2001-2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2001-2007, 2009-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -42,6 +42,7 @@
 #include "write-po.h"
 #include "write-properties.h"
 #include "write-stringtable.h"
+#include "color.h"
 #include "propername.h"
 #include "gettext.h"
 
@@ -81,6 +82,7 @@ static const struct option long_options[] =
   { "clear-fuzzy", no_argument, NULL, CHAR_MAX + 8 },
   { "clear-obsolete", no_argument, NULL, CHAR_MAX + 10 },
   { "clear-previous", no_argument, NULL, CHAR_MAX + 18 },
+  { "color", optional_argument, NULL, CHAR_MAX + 19 },
   { "directory", required_argument, NULL, 'D' },
   { "escape", no_argument, NULL, 'E' },
   { "force-po", no_argument, &force_po, 1 },
@@ -107,6 +109,7 @@ static const struct option long_options[] =
   { "stringtable-input", no_argument, NULL, CHAR_MAX + 16 },
   { "stringtable-output", no_argument, NULL, CHAR_MAX + 17 },
   { "strict", no_argument, NULL, 'S' },
+  { "style", required_argument, NULL, CHAR_MAX + 20 },
   { "translated", no_argument, NULL, CHAR_MAX + 1 },
   { "untranslated", no_argument, NULL, CHAR_MAX + 2 },
   { "version", no_argument, NULL, 'V' },
@@ -312,6 +315,15 @@ main (int argc, char **argv)
         to_change |= REMOVE_PREV;
         break;
 
+      case CHAR_MAX + 19: /* --color */
+        if (handle_color_option (optarg) || color_test_mode)
+          usage (EXIT_FAILURE);
+        break;
+
+      case CHAR_MAX + 20: /* --style */
+        handle_style_option (optarg);
+        break;
+
       default:
         usage (EXIT_FAILURE);
         /* NOTREACHED */
@@ -467,6 +479,12 @@ Input file syntax:\n"));
       printf (_("\
 Output details:\n"));
       printf (_("\
+      --color                 use colors and other text attributes always\n\
+      --color=WHEN            use colors and other text attributes if WHEN.\n\
+                              WHEN may be 'always', 'never', 'auto', or 'html'.\n"));
+      printf (_("\
+      --style=STYLEFILE       specify CSS style rule file for --color\n"));
+      printf (_("\
   -e, --no-escape             do not use C escapes in output (default)\n"));
       printf (_("\
   -E, --escape                use C escapes in output, no extended chars\n"));
index 4df0e9fb62ede2c6e40b268874a1ee7e11b47c55..4daf587625c49d00d97f33438cafbd93abd17f52 100644 (file)
@@ -1,5 +1,5 @@
 /* GNU gettext - internationalization aids
-   Copyright (C) 1997-1998, 2000-2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1997-1998, 2000-2007, 2009-2010 Free Software Foundation, Inc.
 
    This file was written by Peter Miller <millerp@canb.auug.org.au>
 
@@ -44,6 +44,7 @@
 #include "write-po.h"
 #include "write-properties.h"
 #include "write-stringtable.h"
+#include "color.h"
 #include "msgl-cat.h"
 #include "propername.h"
 #include "gettext.h"
@@ -63,6 +64,7 @@ static const char *to_code;
 static const struct option long_options[] =
 {
   { "add-location", no_argument, &line_comment, 1 },
+  { "color", optional_argument, NULL, CHAR_MAX + 5 },
   { "directory", required_argument, NULL, 'D' },
   { "escape", no_argument, NULL, 'E' },
   { "files-from", required_argument, NULL, 'f' },
@@ -82,6 +84,7 @@ static const struct option long_options[] =
   { "strict", no_argument, NULL, 'S' },
   { "stringtable-input", no_argument, NULL, CHAR_MAX + 3 },
   { "stringtable-output", no_argument, NULL, CHAR_MAX + 4 },
+  { "style", required_argument, NULL, CHAR_MAX + 6 },
   { "to-code", required_argument, NULL, 't' },
   { "unique", no_argument, NULL, 'u' },
   { "version", no_argument, NULL, 'V' },
@@ -255,6 +258,15 @@ main (int argc, char *argv[])
         output_syntax = &output_format_stringtable;
         break;
 
+      case CHAR_MAX + 5: /* --color */
+        if (handle_color_option (optarg) || color_test_mode)
+          usage (EXIT_FAILURE);
+        break;
+
+      case CHAR_MAX + 6: /* --style */
+        handle_style_option (optarg);
+        break;
+
       default:
         usage (EXIT_FAILURE);
         /* NOTREACHED */
@@ -404,6 +416,12 @@ Input file syntax:\n"));
       printf (_("\
 Output details:\n"));
       printf (_("\
+      --color                 use colors and other text attributes always\n\
+      --color=WHEN            use colors and other text attributes if WHEN.\n\
+                              WHEN may be 'always', 'never', 'auto', or 'html'.\n"));
+      printf (_("\
+      --style=STYLEFILE       specify CSS style rule file for --color\n"));
+      printf (_("\
   -e, --no-escape             do not use C escapes in output (default)\n"));
       printf (_("\
   -E, --escape                use C escapes in output, no extended chars\n"));
index 70d7a1ec6f9d872682177a4ab282760beb6e41a7..5cdef6168d8564cb04b87492eb94c921cabd6464 100644 (file)
@@ -1,5 +1,5 @@
 /* Converts a translation catalog to a different character encoding.
-   Copyright (C) 2001-2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2001-2007, 2009-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -42,6 +42,7 @@
 #include "write-po.h"
 #include "write-properties.h"
 #include "write-stringtable.h"
+#include "color.h"
 #include "msgl-iconv.h"
 #include "localcharset.h"
 #include "propername.h"
@@ -60,6 +61,7 @@ static const char *to_code;
 static const struct option long_options[] =
 {
   { "add-location", no_argument, &line_comment, 1 },
+  { "color", optional_argument, NULL, CHAR_MAX + 4 },
   { "directory", required_argument, NULL, 'D' },
   { "escape", no_argument, NULL, 'E' },
   { "force-po", no_argument, &force_po, 1 },
@@ -76,6 +78,7 @@ static const struct option long_options[] =
   { "strict", no_argument, NULL, 'S' },
   { "stringtable-input", no_argument, NULL, CHAR_MAX + 2 },
   { "stringtable-output", no_argument, NULL, CHAR_MAX + 3 },
+  { "style", required_argument, NULL, CHAR_MAX + 5 },
   { "to-code", required_argument, NULL, 't' },
   { "version", no_argument, NULL, 'V' },
   { "width", required_argument, NULL, 'w', },
@@ -210,6 +213,15 @@ main (int argc, char **argv)
         output_syntax = &output_format_stringtable;
         break;
 
+      case CHAR_MAX + 4: /* --color */
+        if (handle_color_option (optarg) || color_test_mode)
+          usage (EXIT_FAILURE);
+        break;
+
+      case CHAR_MAX + 5: /* --style */
+        handle_style_option (optarg);
+        break;
+
       default:
         usage (EXIT_FAILURE);
         break;
@@ -332,6 +344,12 @@ Input file syntax:\n"));
       printf (_("\
 Output details:\n"));
       printf (_("\
+      --color                 use colors and other text attributes always\n\
+      --color=WHEN            use colors and other text attributes if WHEN.\n\
+                              WHEN may be 'always', 'never', 'auto', or 'html'.\n"));
+      printf (_("\
+      --style=STYLEFILE       specify CSS style rule file for --color\n"));
+      printf (_("\
   -e, --no-escape             do not use C escapes in output (default)\n"));
       printf (_("\
   -E, --escape                use C escapes in output, no extended chars\n"));
index 4aac39c65ecabc7ed1fbcc5024ea80c98a681f31..0fac062ca37856c97a7d28b806acf4b52ffc19da 100644 (file)
@@ -1,5 +1,5 @@
 /* Creates an English translation catalog.
-   Copyright (C) 2001-2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2001-2007, 2009-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -44,6 +44,7 @@
 #include "write-po.h"
 #include "write-properties.h"
 #include "write-stringtable.h"
+#include "color.h"
 #include "propername.h"
 #include "gettext.h"
 
@@ -57,6 +58,7 @@ static int force_po;
 static const struct option long_options[] =
 {
   { "add-location", no_argument, &line_comment, 1 },
+  { "color", optional_argument, NULL, CHAR_MAX + 5 },
   { "directory", required_argument, NULL, 'D' },
   { "escape", no_argument, NULL, 'E' },
   { "force-po", no_argument, &force_po, 1 },
@@ -74,6 +76,7 @@ static const struct option long_options[] =
   { "strict", no_argument, NULL, 'S' },
   { "stringtable-input", no_argument, NULL, CHAR_MAX + 2 },
   { "stringtable-output", no_argument, NULL, CHAR_MAX + 3 },
+  { "style", required_argument, NULL, CHAR_MAX + 6 },
   { "version", no_argument, NULL, 'V' },
   { "width", required_argument, NULL, 'w', },
   { NULL, 0, NULL, 0 }
@@ -206,6 +209,15 @@ main (int argc, char **argv)
         catalogname = optarg;
         break;
 
+      case CHAR_MAX + 5: /* --color */
+        if (handle_color_option (optarg) || color_test_mode)
+          usage (EXIT_FAILURE);
+        break;
+
+      case CHAR_MAX + 6: /* --style */
+        handle_style_option (optarg);
+        break;
+
       default:
         usage (EXIT_FAILURE);
         break;
@@ -327,6 +339,12 @@ Output details:\n"));
       printf (_("\
       --lang=CATALOGNAME      set 'Language' field in the header entry\n"));
       printf (_("\
+      --color                 use colors and other text attributes always\n\
+      --color=WHEN            use colors and other text attributes if WHEN.\n\
+                              WHEN may be 'always', 'never', 'auto', or 'html'.\n"));
+      printf (_("\
+      --style=STYLEFILE       specify CSS style rule file for --color\n"));
+      printf (_("\
   -e, --no-escape             do not use C escapes in output (default)\n"));
       printf (_("\
   -E, --escape                use C escapes in output, no extended chars\n"));
index a3769899c0072fe4be752efd242cdc7697893d4a..6fa8c72eea6aa5d3be79ead80922339acd927941 100644 (file)
@@ -1,5 +1,5 @@
 /* Edit translations using a subprocess.
-   Copyright (C) 2001-2009 Free Software Foundation, Inc.
+   Copyright (C) 2001-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -47,6 +47,7 @@
 #include "write-po.h"
 #include "write-properties.h"
 #include "write-stringtable.h"
+#include "color.h"
 #include "msgl-charset.h"
 #include "xalloc.h"
 #include "findprog.h"
@@ -87,6 +88,7 @@ static void (*filter) (const char *str, size_t len, char **resultp, size_t *leng
 static const struct option long_options[] =
 {
   { "add-location", no_argument, &line_comment, 1 },
+  { "color", optional_argument, NULL, CHAR_MAX + 6 },
   { "directory", required_argument, NULL, 'D' },
   { "escape", no_argument, NULL, 'E' },
   { "force-po", no_argument, &force_po, 1 },
@@ -105,6 +107,7 @@ static const struct option long_options[] =
   { "strict", no_argument, NULL, 'S' },
   { "stringtable-input", no_argument, NULL, CHAR_MAX + 4 },
   { "stringtable-output", no_argument, NULL, CHAR_MAX + 5 },
+  { "style", required_argument, NULL, CHAR_MAX + 7 },
   { "version", no_argument, NULL, 'V' },
   { "width", required_argument, NULL, 'w', },
   { NULL, 0, NULL, 0 }
@@ -248,6 +251,15 @@ main (int argc, char **argv)
         output_syntax = &output_format_stringtable;
         break;
 
+      case CHAR_MAX + 6: /* --color */
+        if (handle_color_option (optarg) || color_test_mode)
+          usage (EXIT_FAILURE);
+        break;
+
+      case CHAR_MAX + 7: /* --style */
+        handle_style_option (optarg);
+        break;
+
       default:
         usage (EXIT_FAILURE);
         break;
@@ -425,6 +437,12 @@ Input file syntax:\n"));
       printf ("\n");
       printf (_("\
 Output details:\n"));
+      printf (_("\
+      --color                 use colors and other text attributes always\n\
+      --color=WHEN            use colors and other text attributes if WHEN.\n\
+                              WHEN may be 'always', 'never', 'auto', or 'html'.\n"));
+      printf (_("\
+      --style=STYLEFILE       specify CSS style rule file for --color\n"));
       printf (_("\
       --no-escape             do not use C escapes in output (default)\n"));
       printf (_("\
index 34d3b06e52351089bfba9df9ab1bed0b88895ce3..03d9da5d0aca8a2cf821b63c4a31e354a4835d68 100644 (file)
@@ -1,5 +1,5 @@
 /* Extract some translations of a translation catalog.
-   Copyright (C) 2001-2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2001-2007, 2009-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -53,6 +53,7 @@
 #include "write-po.h"
 #include "write-properties.h"
 #include "write-stringtable.h"
+#include "color.h"
 #include "str-list.h"
 #include "msgl-charset.h"
 #include "xalloc.h"
@@ -91,6 +92,7 @@ static struct grep_task grep_task[5];
 static const struct option long_options[] =
 {
   { "add-location", no_argument, &line_comment, 1 },
+  { "color", optional_argument, NULL, CHAR_MAX + 9 },
   { "comment", no_argument, NULL, 'C' },
   { "directory", required_argument, NULL, 'D' },
   { "domain", required_argument, NULL, 'M' },
@@ -120,6 +122,7 @@ static const struct option long_options[] =
   { "strict", no_argument, NULL, 'S' },
   { "stringtable-input", no_argument, NULL, CHAR_MAX + 7 },
   { "stringtable-output", no_argument, NULL, CHAR_MAX + 8 },
+  { "style", required_argument, NULL, CHAR_MAX + 10 },
   { "version", no_argument, NULL, 'V' },
   { "width", required_argument, NULL, 'w' },
   { NULL, 0, NULL, 0 }
@@ -385,6 +388,15 @@ error while reading \"%s\""), optarg);
         output_syntax = &output_format_stringtable;
         break;
 
+      case CHAR_MAX + 9: /* --color */
+        if (handle_color_option (optarg) || color_test_mode)
+          usage (EXIT_FAILURE);
+        break;
+
+      case CHAR_MAX + 10: /* --style */
+        handle_style_option (optarg);
+        break;
+
       default:
         usage (EXIT_FAILURE);
         break;
@@ -574,6 +586,12 @@ Input file syntax:\n"));
       printf ("\n");
       printf (_("\
 Output details:\n"));
+      printf (_("\
+      --color                 use colors and other text attributes always\n\
+      --color=WHEN            use colors and other text attributes if WHEN.\n\
+                              WHEN may be 'always', 'never', 'auto', or 'html'.\n"));
+      printf (_("\
+      --style=STYLEFILE       specify CSS style rule file for --color\n"));
       printf (_("\
       --no-escape             do not use C escapes in output (default)\n"));
       printf (_("\
index 787636a65d0f53fb334490ce33a4a78dcd465d28..2f5d5012a4e459d7d204f860656a6053bec3d22c 100644 (file)
@@ -1,5 +1,5 @@
 /* Initializes a new PO file.
-   Copyright (C) 2001-2009 Free Software Foundation, Inc.
+   Copyright (C) 2001-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -65,6 +65,7 @@
 #include "write-po.h"
 #include "write-properties.h"
 #include "write-stringtable.h"
+#include "color.h"
 #include "po-charset.h"
 #include "localcharset.h"
 #include "localename.h"
@@ -112,6 +113,7 @@ static bool no_translator;
 /* Long options.  */
 static const struct option long_options[] =
 {
+  { "color", optional_argument, NULL, CHAR_MAX + 5 },
   { "help", no_argument, NULL, 'h' },
   { "input", required_argument, NULL, 'i' },
   { "locale", required_argument, NULL, 'l' },
@@ -122,6 +124,7 @@ static const struct option long_options[] =
   { "properties-output", no_argument, NULL, 'p' },
   { "stringtable-input", no_argument, NULL, CHAR_MAX + 3 },
   { "stringtable-output", no_argument, NULL, CHAR_MAX + 4 },
+  { "style", required_argument, NULL, CHAR_MAX + 6 },
   { "version", no_argument, NULL, 'V' },
   { "width", required_argument, NULL, 'w' },
   { NULL, 0, NULL, 0 }
@@ -243,6 +246,15 @@ main (int argc, char **argv)
         output_syntax = &output_format_stringtable;
         break;
 
+      case CHAR_MAX + 5: /* --color */
+        if (handle_color_option (optarg) || color_test_mode)
+          usage (EXIT_FAILURE);
+        break;
+
+      case CHAR_MAX + 6: /* --style */
+        handle_style_option (optarg);
+        break;
+
       default:
         usage (EXIT_FAILURE);
         break;
@@ -390,6 +402,12 @@ Output details:\n"));
       printf (_("\
       --no-translator         assume the PO file is automatically generated\n"));
       printf (_("\
+      --color                 use colors and other text attributes always\n\
+      --color=WHEN            use colors and other text attributes if WHEN.\n\
+                              WHEN may be 'always', 'never', 'auto', or 'html'.\n"));
+      printf (_("\
+      --style=STYLEFILE       specify CSS style rule file for --color\n"));
+      printf (_("\
   -p, --properties-output     write out a Java .properties file\n"));
       printf (_("\
       --stringtable-output    write out a NeXTstep/GNUstep .strings file\n"));
index fde4ee5037564d2a34c3f873b963c8d883fcfc85..eab8ae9817a9db63f12b005496b7b84265924bda 100644 (file)
@@ -1,5 +1,5 @@
 /* GNU gettext - internationalization aids
-   Copyright (C) 1995-1998, 2000-2009 Free Software Foundation, Inc.
+   Copyright (C) 1995-1998, 2000-2010 Free Software Foundation, Inc.
    This file was written by Peter Miller <millerp@canb.auug.org.au>
 
    This program is free software: you can redistribute it and/or modify
@@ -44,6 +44,7 @@
 #include "write-po.h"
 #include "write-properties.h"
 #include "write-stringtable.h"
+#include "color.h"
 #include "format.h"
 #include "xalloc.h"
 #include "xmalloca.h"
@@ -108,6 +109,7 @@ static const struct option long_options[] =
 {
   { "add-location", no_argument, &line_comment, 1 },
   { "backup", required_argument, NULL, CHAR_MAX + 1 },
+  { "color", optional_argument, NULL, CHAR_MAX + 9 },
   { "compendium", required_argument, NULL, 'C', },
   { "directory", required_argument, NULL, 'D' },
   { "escape", no_argument, NULL, 'E' },
@@ -131,6 +133,7 @@ static const struct option long_options[] =
   { "strict", no_argument, NULL, CHAR_MAX + 2 },
   { "stringtable-input", no_argument, NULL, CHAR_MAX + 5 },
   { "stringtable-output", no_argument, NULL, CHAR_MAX + 6 },
+  { "style", required_argument, NULL, CHAR_MAX + 10 },
   { "suffix", required_argument, NULL, CHAR_MAX + 3 },
   { "update", no_argument, NULL, 'U' },
   { "verbose", no_argument, NULL, 'v' },
@@ -319,6 +322,15 @@ main (int argc, char **argv)
         catalogname = optarg;
         break;
 
+      case CHAR_MAX + 9: /* --color */
+        if (handle_color_option (optarg) || color_test_mode)
+          usage (EXIT_FAILURE);
+        break;
+
+      case CHAR_MAX + 10: /* --style */
+        handle_style_option (optarg);
+        break;
+
       default:
         usage (EXIT_FAILURE);
         break;
@@ -553,6 +565,12 @@ Output details:\n"));
       printf (_("\
       --lang=CATALOGNAME      set 'Language' field in the header entry\n"));
       printf (_("\
+      --color                 use colors and other text attributes always\n\
+      --color=WHEN            use colors and other text attributes if WHEN.\n\
+                              WHEN may be 'always', 'never', 'auto', or 'html'.\n"));
+      printf (_("\
+      --style=STYLEFILE       specify CSS style rule file for --color\n"));
+      printf (_("\
   -e, --no-escape             do not use C escapes in output (default)\n"));
       printf (_("\
   -E, --escape                use C escapes in output, no extended chars\n"));
index 51884d31f4ec3f462a54949d95fb86306737c46c..34faeba7a3ea17f2e6b8e960854a927820753483 100644 (file)
@@ -1,5 +1,5 @@
 /* msgunfmt - converts binary .mo files to Uniforum style .po files
-   Copyright (C) 1995-1998, 2000-2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1995-1998, 2000-2007, 2009-2010 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
@@ -43,6 +43,7 @@
 #include "write-po.h"
 #include "write-properties.h"
 #include "write-stringtable.h"
+#include "color.h"
 #include "propername.h"
 #include "gettext.h"
 
@@ -77,6 +78,7 @@ static int force_po;
 /* Long options.  */
 static const struct option long_options[] =
 {
+  { "color", optional_argument, NULL, CHAR_MAX + 6 },
   { "csharp", no_argument, NULL, CHAR_MAX + 4 },
   { "csharp-resources", no_argument, NULL, CHAR_MAX + 5 },
   { "escape", no_argument, NULL, 'E' },
@@ -93,6 +95,7 @@ static const struct option long_options[] =
   { "sort-output", no_argument, NULL, 's' },
   { "strict", no_argument, NULL, 'S' },
   { "stringtable-output", no_argument, NULL, CHAR_MAX + 3 },
+  { "style", required_argument, NULL, CHAR_MAX + 7 },
   { "tcl", no_argument, NULL, CHAR_MAX + 1 },
   { "verbose", no_argument, NULL, 'v' },
   { "version", no_argument, NULL, 'V' },
@@ -237,6 +240,15 @@ main (int argc, char **argv)
         csharp_resources_mode = true;
         break;
 
+      case CHAR_MAX + 6: /* --color */
+        if (handle_color_option (optarg) || color_test_mode)
+          usage (EXIT_FAILURE);
+        break;
+
+      case CHAR_MAX + 7: /* --style */
+        handle_style_option (optarg);
+        break;
+
       default:
         usage (EXIT_FAILURE);
         break;
@@ -485,6 +497,12 @@ or if it is -.\n"));
       printf (_("\
 Output details:\n"));
       printf (_("\
+      --color                 use colors and other text attributes always\n\
+      --color=WHEN            use colors and other text attributes if WHEN.\n\
+                              WHEN may be 'always', 'never', 'auto', or 'html'.\n"));
+      printf (_("\
+      --style=STYLEFILE       specify CSS style rule file for --color\n"));
+      printf (_("\
   -e, --no-escape             do not use C escapes in output (default)\n"));
       printf (_("\
   -E, --escape                use C escapes in output, no extended chars\n"));
index 4751d7246353c866b2d56d002be494698bbcfd55..31d10e0822f08c7c1d180f6affc743649691ab99 100644 (file)
@@ -1,5 +1,5 @@
 /* Remove, select or merge duplicate translations.
-   Copyright (C) 2001-2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2001-2007, 2009-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -43,6 +43,7 @@
 #include "write-po.h"
 #include "write-properties.h"
 #include "write-stringtable.h"
+#include "color.h"
 #include "msgl-cat.h"
 #include "propername.h"
 #include "gettext.h"
@@ -60,6 +61,7 @@ static const char *to_code;
 static const struct option long_options[] =
 {
   { "add-location", no_argument, &line_comment, 1 },
+  { "color", optional_argument, NULL, CHAR_MAX + 5 },
   { "directory", required_argument, NULL, 'D' },
   { "escape", no_argument, NULL, 'E' },
   { "force-po", no_argument, &force_po, 1 },
@@ -77,6 +79,7 @@ static const struct option long_options[] =
   { "strict", no_argument, NULL, 'S' },
   { "stringtable-input", no_argument, NULL, CHAR_MAX + 3 },
   { "stringtable-output", no_argument, NULL, CHAR_MAX + 4 },
+  { "style", required_argument, NULL, CHAR_MAX + 6 },
   { "to-code", required_argument, NULL, 't' },
   { "unique", no_argument, NULL, 'u' },
   { "use-first", no_argument, NULL, CHAR_MAX + 1 },
@@ -234,6 +237,15 @@ main (int argc, char **argv)
         output_syntax = &output_format_stringtable;
         break;
 
+      case CHAR_MAX + 5: /* --color */
+        if (handle_color_option (optarg) || color_test_mode)
+          usage (EXIT_FAILURE);
+        break;
+
+      case CHAR_MAX + 6: /* --style */
+        handle_style_option (optarg);
+        break;
+
       default:
         usage (EXIT_FAILURE);
         /* NOTREACHED */
@@ -368,6 +380,12 @@ Output details:\n"));
       --use-first             use first available translation for each\n\
                               message, don't merge several translations\n"));
       printf (_("\
+      --color                 use colors and other text attributes always\n\
+      --color=WHEN            use colors and other text attributes if WHEN.\n\
+                              WHEN may be 'always', 'never', 'auto', or 'html'.\n"));
+      printf (_("\
+      --style=STYLEFILE       specify CSS style rule file for --color\n"));
+      printf (_("\
   -e, --no-escape             do not use C escapes in output (default)\n"));
       printf (_("\
   -E, --escape                use C escapes in output, no extended chars\n"));
index 41cd1f0d5de169a12ed04bb6232797b7b298ab5a..a062de6a3f54a647bd8601529d4ca470cc8eb967 100644 (file)
@@ -63,6 +63,7 @@
 #include "write-po.h"
 #include "write-properties.h"
 #include "write-stringtable.h"
+#include "color.h"
 #include "format.h"
 #include "propername.h"
 #include "gettext.h"
@@ -194,6 +195,7 @@ static const struct option long_options[] =
   { "add-location", no_argument, &line_comment, 1 },
   { "boost", no_argument, NULL, CHAR_MAX + 11 },
   { "c++", no_argument, NULL, 'C' },
+  { "color", optional_argument, NULL, CHAR_MAX + 14 },
   { "copyright-holder", required_argument, NULL, CHAR_MAX + 1 },
   { "debug", no_argument, &do_debug, 1 },
   { "default-domain", required_argument, NULL, 'd' },
@@ -230,6 +232,7 @@ static const struct option long_options[] =
   { "strict", no_argument, NULL, 'S' },
   { "string-limit", required_argument, NULL, 'l' },
   { "stringtable-output", no_argument, NULL, CHAR_MAX + 7 },
+  { "style", required_argument, NULL, CHAR_MAX + 15 },
   { "trigraphs", no_argument, NULL, 'T' },
   { "version", no_argument, NULL, 'V' },
   { "width", required_argument, NULL, 'w', },
@@ -559,6 +562,15 @@ main (int argc, char *argv[])
         package_version = optarg;
         break;
 
+      case CHAR_MAX + 14: /* --color */
+        if (handle_color_option (optarg) || color_test_mode)
+          usage (EXIT_FAILURE);
+        break;
+
+      case CHAR_MAX + 15: /* --style */
+        handle_style_option (optarg);
+        break;
+
       default:
         usage (EXIT_FAILURE);
         /* NOTREACHED */
@@ -914,6 +926,12 @@ Language specific options:\n"));
       printf (_("\
 Output details:\n"));
       printf (_("\
+      --color                 use colors and other text attributes always\n\
+      --color=WHEN            use colors and other text attributes if WHEN.\n\
+                              WHEN may be 'always', 'never', 'auto', or 'html'.\n"));
+      printf (_("\
+      --style=STYLEFILE       specify CSS style rule file for --color\n"));
+      printf (_("\
   -e, --no-escape             do not use C escapes in output (default)\n"));
       printf (_("\
   -E, --escape                use C escapes in output, no extended chars\n"));