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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitter:  None
Submitted:  Wed 30 Jan 2013 07:19:09 PM UTC
   
 
Category:  Translator tools Severity:  3 - Normal
Item Group:  None Status:  Works For Me
Privacy:  Public Assigned to:  m1gu3l
Open/Closed:  Closed

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

Please, read the full text:


$ msggrep --help | fgrep -A3 -B1 "PATTERN syntax:"
MSGCTXT-PATTERN or MSGID-PATTERN or MSGSTR-PATTERN or COMMENT-PATTERN or
EXTRACTED-COMMENT-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.
$ msggrep --version
msggrep (GNU gettext-tools) 0.18.1


Miguel Ángel Arruga Vivas <m1gu3l>
Group Member
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:


$ msggrep --help | grep -A3 "Message selection"
Message selection:
  [-N SOURCEFILE]... [-M DOMAINNAME]...
  [-J MSGCTXT-PATTERN] [-K MSGID-PATTERN] [-T MSGSTR-PATTERN]
  [-C COMMENT-PATTERN] [-X EXTRACTED-COMMENT-PATTERN]

$ msggrep --version
msggrep (GNU gettext-tools) 0.18.2


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:

<output>
   MSGCTXT-PATTERN or 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.
<output>

Miguel Ángel Arruga Vivas <m1gu3l>
Group Member
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.

Anonymous

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by acdha (Posted a comment)
  • -email is unavailable- added by m1gu3l (Posted a comment)
  • -email is unavailable- added by acdha
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-27 haible CategoryNone Translator tools
    2013-03-13 m1gu3l Open/ClosedOpen Closed
    2013-02-28 m1gu3l StatusNot a Bug Works For Me
    2013-02-28 m1gu3l StatusNone Not a Bug
        Assigned toNone m1gu3l
    2013-01-30 acdha Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code