bugGNU gettext - Bugs: bug #38205, msggrep: field selection is...


bug #38205: msggrep: field selection is cumbersome, incorrectly documented

Submitted by:  None
Submitted on:  Wed 30 Jan 2013 07:19:09 PM UTC  
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Works For Me
Privacy: PublicAssigned to: Miguel Ángel Arruga Vivas <m1gu3l>
Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Mon 04 Feb 2013 11:42:09 PM UTC, comment #3:

Please, read the full text:

Miguel Ángel Arruga Vivas <m1gu3l>
Project MemberIn charge of this item.
Mon 04 Feb 2013 09:09:09 PM UTC, comment #2:

Miguel: it remains a bug - see the --help output as quoted in the original message:

As noted in my original message, you cannot specify the pattern as the argument for the flag as shown above – you must provide it as a separate argument to a different flag (--regexp).

Chris Adams <acdha>
Mon 04 Feb 2013 06:44:17 PM UTC, comment #1:

It is not a bug, It is a feature request.

From msggrep info and --help:

[-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.

Miguel Ángel Arruga Vivas <m1gu3l>
Project MemberIn charge of this item.
Wed 30 Jan 2013 07:19:09 PM UTC, original submission:

Using msggrep (GNU gettext-tools) 0.18.1:

Message selection:

This misleadingly suggests that the pattern is an argument for the flags which select the field to search. Unfortunately, this does not actually work:

$ msggrep -T Bug locale/en_US/LC_MESSAGES/django.po
msggrep: at most one input file allowed
Try `msggrep --help' for more information.

$ msggrep --msgstr=Topic locale/en_US/LC_MESSAGES/django.po
msggrep: option '--msgstr' doesn't allow an argument
Try `msggrep --help' for more information.

Instead, the arguments must be provided to the --regexp option, which works but is particularly counterintuitive when using fixed strings:

$ msggrep --msgstr --fixed-strings --regexp 'Bug' locale/en_US/LC_MESSAGES/django.po

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:

msggrep --msgid Bug locale/en_US/LC_MESSAGES/django.po

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.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by acdha (Posted a comment)
  • -unavailable- added by m1gu3l (Posted a comment)
  • -unavailable- added by acdha

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 13 Mar 2013 10:53:01 AM UTCm1gu3lOpen/ClosedOpen=>Closed
    Thu 28 Feb 2013 10:32:19 AM UTCm1gu3lStatusNot a Bug=>Works For Me
    Thu 28 Feb 2013 10:31:16 AM UTCm1gu3lStatusNone=>Not a Bug
      Assigned toNone=>m1gu3l
    Wed 30 Jan 2013 07:23:08 PM UTCacdhaCarbon-Copy-=>Added -unavailable-

    Back to the top

    Powered by Savane 3.1-cleanup