Wed 30 Jan 2013 07:19:09 PM UTC, original submission:
Using msggrep (GNU gettext-tools) 0.18.1:
<output>
Message selection:
[-N SOURCEFILE]... [-M DOMAINNAME]...
[-J MSGCTXT-PATTERN] [-K MSGID-PATTERN] [-T MSGSTR-PATTERN]
[-C COMMENT-PATTERN] [-X EXTRACTED-COMMENT-PATTERN]
</output>
This misleadingly suggests that the pattern is an argument for the flags which select the field to search. Unfortunately, this does not actually work:
<output>
$ msggrep -T Bug locale/en_US/LC_MESSAGES/django.po
msggrep: at most one input file allowed
Try `msggrep --help' for more information.
</output>
<output>
$ msggrep --msgstr=Topic locale/en_US/LC_MESSAGES/django.po
msggrep: option '--msgstr' doesn't allow an argument
Try `msggrep --help' for more information.
</output>
Instead, the arguments must be provided to the --regexp option, which works but is particularly counterintuitive when using fixed strings:
<output>
$ msggrep --msgstr --fixed-strings --regexp 'Bug' locale/en_US/LC_MESSAGES/django.po
</output>
The best way to fix this would be for msggrep to move closer to grep and simply allow you to provide the pattern as the first of two positional arguments:
<samp>
msggrep --msgid Bug locale/en_US/LC_MESSAGES/django.po
</samp>
This might even be backwards compatible as msggrep has historically prevented you from using more than one positional argument.
However, the easiest fix might simply be to update the documentation and provide an example of basic usage.
|