bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug#573704: gettext: msgunfmt colorizes if stdout is terminal, but does


From: Santiago Vila
Subject: Bug#573704: gettext: msgunfmt colorizes if stdout is terminal, but does not recognize --color (fwd)
Date: Sat, 13 Mar 2010 12:05:39 +0100 (CET)

Hello.

Received this from the debian bts:

---------- Forwarded message ----------
From: Kalle Olavi Niemitalo <address@hidden>
To: Debian Bug Tracking System <address@hidden>
Date: Sat, 13 Mar 2010 12:14:40 +0200
Subject: Bug#573704: gettext: msgunfmt colorizes if stdout is terminal,
    but does not recognize --color 

Package: gettext
Version: 0.17-9
Severity: wishlist

If I run this in gnome-terminal:

% msgunfmt /usr/share/locale/fi/LC_MESSAGES/gnome-session-2.0.mo

then msgunfmt makes msgids purple and msgstrs blue, by adding
escape sequences like "\033[34m" to the output.  However, if I
pipe the output to less, like so:

% msgunfmt /usr/share/locale/fi/LC_MESSAGES/gnome-session-2.0.mo |
  less -R

then I do not get any colors.  Apparently, msgunfmt detects that
stdout is not a terminal.  Such detection is all right but there
should be a way to enable colors regardless.  In ls and git, this
is done with a --color option, but msgunfmt does not support that:

% LANG=C msgunfmt --color /usr/share/locale/fi/LC_MESSAGES/gnome-session-2.0.mo
msgunfmt: unrecognized option '--color'
Try `msgunfmt --help' for more information.

I can instead get the desired result by filtering the output
through msgcat:

% msgunfmt /usr/share/locale/fi/LC_MESSAGES/gnome-session-2.0.mo |
  msgcat --color - |
  less -R

but it seems silly that msgunfmt cannot do this on its own, given
that it already supports colorizing the output to a terminal.

[...]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]