[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
msggrep on text from comments
From: |
Martin Quinson |
Subject: |
msggrep on text from comments |
Date: |
Mon, 3 Mar 2003 23:00:41 +0100 |
User-agent: |
Mutt/1.5.3i |
Hello,
I found several problems in gettext 0.11.5 :
1) The existance of the -C flag to search in comments with msggrep is not
documented well in the documentation:
<<<<<<<<<<<
MSGID-PATTERN or MSGSTR-PATTERN syntax:
[-E | -F] [-e PATTERN | -f FILE]...
PATTERNs are basic regular expressions by default, or extended regular
expressions if -E is given, or fixed strings if -F is given.
-N, --location=SOURCEFILE
select messages extracted from SOURCEFILE
-M, --domain=DOMAINNAME
select messages belonging to domain DOMAINNAME
-K, --msgid
start of patterns for the msgid
-T, --msgstr
start of patterns for the msgstr
-E, --extended-regexp
PATTERN is an extended regular expression
-F, --fixed-strings
PATTERN is a set of newline-separated strings
-e, --regexp=PATTERN
use PATTERN as a regular expression
>>>>>>>>>>>
msggrep --help is exactly as few informative as the man page.
2) Some example of use of msggrep would be very welcome in this page. For
example:
msggrep -C -F -e FIXME file.po
will extract all entries with "FIXME" in the comments
msggrep -K -F -e framebuffer -T -F -e framebuffer file.po
will extract all entries using the word framebuffer without translating
it (ie this word is present in the msgid and in the msgstr).
3) like 1, if I do some syntax error (which is pretty easy since the
syntax is so hard to figure), I get wrong error messages.
<<<<<<<<<<<
$ msggrep -F file.po
msggrep: option 'F' cannot be used before 'K' or 'T' has been specified
Try msggrep --help' for more information.
>>>>>>>>>>>
and what about the 'C' ?
4) Combining the result of several msggrep or msgattrib is very difficult,
since all of them write the header of the file. For example, if I want
the entries being either untranslated or fuzzy plus all entries having
FIXME in their comments, I would have to do something like :
(msgattrib --only-fuzzy file.po ; \
msgattrib --untranslated file.po ; \
msggrep -C -F -e FIXME file.po) > output
Letting alone that this syntax is not really easy, the produced file won't
be correct, due to the presence of 3 headers.
Piping them to msguniq or msgcat does not help. Is it because the
dupplicated field is the header ? I have no idea about how to solve that
without introducing yet another option to the msg{attrib,grep} binaries.
Bye, Mt.
--
Quelqu'un qui a commis des atrocités mérite la peine de mort. Ainsi, il
retiendra la leçon pour la prochaine fois.
--- Britney Spears