From: Bruno Haible Date: Sat, 13 Mar 2010 14:04:10 +0000 (+0100) Subject: New options --color, --style for many programs. X-Git-Tag: v0.18~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d205628d5822bb9ebfaf7eb6ab0aaaeff63848c;p=thirdparty%2Fgettext.git New options --color, --style for many programs. --- diff --git a/ChangeLog b/ChangeLog index ac640e75a..e7e65ede8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-03-13 Bruno Haible + + * NEWS: Mention the --color and --style options on many programs. + 2010-01-19 Bruno Haible * AUTHORS: Update from fencepost.gnu.org:/gd/gnuorg/copyright.list. diff --git a/NEWS b/NEWS index 57344469c..1d3a4e070 100644 --- 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. diff --git a/gettext-tools/doc/ChangeLog b/gettext-tools/doc/ChangeLog index 133d0dd08..6105b937d 100644 --- a/gettext-tools/doc/ChangeLog +++ b/gettext-tools/doc/ChangeLog @@ -1,3 +1,20 @@ +2010-03-13 Bruno Haible + + 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 + via Santiago Vila . + 2010-02-20 Bruno Haible * gettext.texi (Plural forms): Add Bulgarian. diff --git a/gettext-tools/doc/msgattrib.texi b/gettext-tools/doc/msgattrib.texi index 596d6184f..39fe7eebd 100644 --- a/gettext-tools/doc/msgattrib.texi +++ b/gettext-tools/doc/msgattrib.texi @@ -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. diff --git a/gettext-tools/doc/msgcomm.texi b/gettext-tools/doc/msgcomm.texi index cff0c90a3..72e0aad99 100644 --- a/gettext-tools/doc/msgcomm.texi +++ b/gettext-tools/doc/msgcomm.texi @@ -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. diff --git a/gettext-tools/doc/msgconv.texi b/gettext-tools/doc/msgconv.texi index c5f53f6ee..6e58fd23e 100644 --- a/gettext-tools/doc/msgconv.texi +++ b/gettext-tools/doc/msgconv.texi @@ -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. diff --git a/gettext-tools/doc/msgen.texi b/gettext-tools/doc/msgen.texi index 6686c8393..f45444be5 100644 --- a/gettext-tools/doc/msgen.texi +++ b/gettext-tools/doc/msgen.texi @@ -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. diff --git a/gettext-tools/doc/msgfilter.texi b/gettext-tools/doc/msgfilter.texi index 736373d6b..05c3fb883 100644 --- a/gettext-tools/doc/msgfilter.texi +++ b/gettext-tools/doc/msgfilter.texi @@ -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. diff --git a/gettext-tools/doc/msggrep.texi b/gettext-tools/doc/msggrep.texi index c2adebc17..31bc81591 100644 --- a/gettext-tools/doc/msggrep.texi +++ b/gettext-tools/doc/msggrep.texi @@ -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. diff --git a/gettext-tools/doc/msginit.texi b/gettext-tools/doc/msginit.texi index 5b0f52535..889887df0 100644 --- a/gettext-tools/doc/msginit.texi +++ b/gettext-tools/doc/msginit.texi @@ -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} diff --git a/gettext-tools/doc/msgmerge.texi b/gettext-tools/doc/msgmerge.texi index e924d4f99..481694157 100644 --- a/gettext-tools/doc/msgmerge.texi +++ b/gettext-tools/doc/msgmerge.texi @@ -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. diff --git a/gettext-tools/doc/msgunfmt.texi b/gettext-tools/doc/msgunfmt.texi index 6b710cc57..ed85f816a 100644 --- a/gettext-tools/doc/msgunfmt.texi +++ b/gettext-tools/doc/msgunfmt.texi @@ -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. diff --git a/gettext-tools/doc/msguniq.texi b/gettext-tools/doc/msguniq.texi index 43bb48236..120a8fec2 100644 --- a/gettext-tools/doc/msguniq.texi +++ b/gettext-tools/doc/msguniq.texi @@ -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. diff --git a/gettext-tools/doc/xgettext.texi b/gettext-tools/doc/xgettext.texi index 263dbc8cb..bc7e633e0 100644 --- a/gettext-tools/doc/xgettext.texi +++ b/gettext-tools/doc/xgettext.texi @@ -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. diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 325c2db40..327e7d125 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,53 @@ +2010-03-13 Bruno Haible + + 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 + via Santiago Vila . + 2010-02-20 Bruno Haible * plural-table.c (plural_table): Add Bulgarian. diff --git a/gettext-tools/src/msgattrib.c b/gettext-tools/src/msgattrib.c index d5c8d40d6..73b7942d1 100644 --- a/gettext-tools/src/msgattrib.c +++ b/gettext-tools/src/msgattrib.c @@ -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 , 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")); diff --git a/gettext-tools/src/msgcomm.c b/gettext-tools/src/msgcomm.c index 4df0e9fb6..4daf58762 100644 --- a/gettext-tools/src/msgcomm.c +++ b/gettext-tools/src/msgcomm.c @@ -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 @@ -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")); diff --git a/gettext-tools/src/msgconv.c b/gettext-tools/src/msgconv.c index 70d7a1ec6..5cdef6168 100644 --- a/gettext-tools/src/msgconv.c +++ b/gettext-tools/src/msgconv.c @@ -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 , 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")); diff --git a/gettext-tools/src/msgen.c b/gettext-tools/src/msgen.c index 4aac39c65..0fac062ca 100644 --- a/gettext-tools/src/msgen.c +++ b/gettext-tools/src/msgen.c @@ -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 , 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")); diff --git a/gettext-tools/src/msgfilter.c b/gettext-tools/src/msgfilter.c index a3769899c..6fa8c72ee 100644 --- a/gettext-tools/src/msgfilter.c +++ b/gettext-tools/src/msgfilter.c @@ -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 , 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 (_("\ diff --git a/gettext-tools/src/msggrep.c b/gettext-tools/src/msggrep.c index 34d3b06e5..03d9da5d0 100644 --- a/gettext-tools/src/msggrep.c +++ b/gettext-tools/src/msggrep.c @@ -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 , 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 (_("\ diff --git a/gettext-tools/src/msginit.c b/gettext-tools/src/msginit.c index 787636a65..2f5d5012a 100644 --- a/gettext-tools/src/msginit.c +++ b/gettext-tools/src/msginit.c @@ -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 , 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")); diff --git a/gettext-tools/src/msgmerge.c b/gettext-tools/src/msgmerge.c index fde4ee503..eab8ae981 100644 --- a/gettext-tools/src/msgmerge.c +++ b/gettext-tools/src/msgmerge.c @@ -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 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")); diff --git a/gettext-tools/src/msgunfmt.c b/gettext-tools/src/msgunfmt.c index 51884d31f..34faeba7a 100644 --- a/gettext-tools/src/msgunfmt.c +++ b/gettext-tools/src/msgunfmt.c @@ -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 , 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")); diff --git a/gettext-tools/src/msguniq.c b/gettext-tools/src/msguniq.c index 4751d7246..31d10e082 100644 --- a/gettext-tools/src/msguniq.c +++ b/gettext-tools/src/msguniq.c @@ -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 , 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")); diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index 41cd1f0d5..a062de6a3 100644 --- a/gettext-tools/src/xgettext.c +++ b/gettext-tools/src/xgettext.c @@ -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"));