msggrep - phpMan

File: gettext.info,  Node: msggrep Invocation,  Next: msgfilter Invocation,  Prev: msgconv Invocation,  Up: Manipulating
9.3 Invoking the ā€˜msggrepā€™ Program
==================================
     msggrep [OPTION] [INPUTFILE]
   The ā€˜msggrepā€™ program extracts all messages of a translation catalog
that match a given pattern or belong to some given source files.
9.3.1 Input file location
-------------------------
ā€˜INPUTFILEā€™
     Input PO file.
ā€˜-D DIRECTORYā€™
ā€˜--directory=DIRECTORYā€™
     Add DIRECTORY to the list of directories.  Source files are
     searched relative to this list of directories.  The resulting ā€˜.poā€™
     file will be written relative to the current directory, though.
   If no INPUTFILE is given or if it is ā€˜-ā€™, standard input is read.
9.3.2 Output file location
--------------------------
ā€˜-o FILEā€™
ā€˜--output-file=FILEā€™
     Write output to specified file.
   The results are written to standard output if no output file is
specified or if it is ā€˜-ā€™.
9.3.3 Message selection
-----------------------
       [-N SOURCEFILE]... [-M DOMAINNAME]...
       [-J MSGCTXT-PATTERN] [-K MSGID-PATTERN] [-T MSGSTR-PATTERN]
       [-C COMMENT-PATTERN]
   A message is selected if
   ā€¢ it comes from one of the specified source files,
   ā€¢ or if it comes from one of the specified domains,
   ā€¢ or if ā€˜-Jā€™ is given and its context (msgctxt) matches
     MSGCTXT-PATTERN,
   ā€¢ or if ā€˜-Kā€™ is given and its key (msgid or msgid_plural) matches
     MSGID-PATTERN,
   ā€¢ or if ā€˜-Tā€™ is given and its translation (msgstr) matches
     MSGSTR-PATTERN,
   ā€¢ or if ā€˜-Cā€™ is given and the translatorā€™s comment matches
     COMMENT-PATTERN.
   When more than one selection criterion is specified, the set of
selected messages is the union of the selected messages of each
criterion.
   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.
ā€˜-N SOURCEFILEā€™
ā€˜--location=SOURCEFILEā€™
     Select messages extracted from SOURCEFILE.  SOURCEFILE can be
     either a literal file name or a wildcard pattern.
ā€˜-M DOMAINNAMEā€™
ā€˜--domain=DOMAINNAMEā€™
     Select messages belonging to domain DOMAINNAME.
ā€˜-Jā€™
ā€˜--msgctxtā€™
     Start of patterns for the msgctxt.
ā€˜-Kā€™
ā€˜--msgidā€™
     Start of patterns for the msgid.
ā€˜-Tā€™
ā€˜--msgstrā€™
     Start of patterns for the msgstr.
ā€˜-Cā€™
ā€˜--commentā€™
     Start of patterns for the translatorā€™s comment.
ā€˜-Xā€™
ā€˜--extracted-commentā€™
     Start of patterns for the extracted comments.
ā€˜-Eā€™
ā€˜--extended-regexpā€™
     Specify that PATTERN is an extended regular expression.
ā€˜-Fā€™
ā€˜--fixed-stringsā€™
     Specify that PATTERN is a set of newline-separated strings.
ā€˜-e PATTERNā€™
ā€˜--regexp=PATTERNā€™
     Use PATTERN as a regular expression.
ā€˜-f FILEā€™
ā€˜--file=FILEā€™
     Obtain PATTERN from FILE.
ā€˜-iā€™
ā€˜--ignore-caseā€™
     Ignore case distinctions.
ā€˜-vā€™
ā€˜--invert-matchā€™
     Output only the messages that do not match any selection criterion,
     instead of the messages that match a selection criterion.
9.3.4 Input file syntax
-----------------------
ā€˜-Pā€™
ā€˜--properties-inputā€™
     Assume the input file is a Java ResourceBundle in Java
     ā€˜.propertiesā€™ syntax, not in PO file syntax.
ā€˜--stringtable-inputā€™
     Assume the input file is a NeXTstep/GNUstep localized resource file
     in ā€˜.stringsā€™ syntax, not in PO file syntax.
9.3.5 Output details
--------------------
ā€˜--colorā€™
ā€˜--color=WHENā€™
     Specify whether or when to use colors and other text attributes.
     See *note The --color option:: for details.
ā€˜--style=STYLE_FILEā€™
     Specify the CSS style rule file to use for ā€˜--colorā€™.  See *note
     The --style option:: for details.
ā€˜--force-poā€™
     Always write an output file even if it contains no message.
ā€˜--indentā€™
     Write the .po file using indented style.
ā€˜--no-locationā€™
     Do not write ā€˜#: FILENAME:LINEā€™ lines.
ā€˜-nā€™
ā€˜--add-location=TYPEā€™
     Generate ā€˜#: FILENAME:LINEā€™ lines (default).
     The optional TYPE can be either ā€˜fullā€™, ā€˜fileā€™, or ā€˜neverā€™.  If it
     is not given or ā€˜fullā€™, it generates the lines with both file name
     and line number.  If it is ā€˜fileā€™, the line number part is omitted.
     If it is ā€˜neverā€™, it completely suppresses the lines (same as
     ā€˜--no-locationā€™).
ā€˜--strictā€™
     Write out a strict Uniforum conforming PO file.  Note that this
     Uniforum format should be avoided because it doesnā€™t support the
     GNU extensions.
ā€˜-pā€™
ā€˜--properties-outputā€™
     Write out a Java ResourceBundle in Java ā€˜.propertiesā€™ syntax.  Note
     that this file format doesnā€™t support plural forms and silently
     drops obsolete messages.
ā€˜--stringtable-outputā€™
     Write out a NeXTstep/GNUstep localized resource file in ā€˜.stringsā€™
     syntax.  Note that this file format doesnā€™t support plural forms.
ā€˜-w NUMBERā€™
ā€˜--width=NUMBERā€™
     Set the output page width.  Long strings in the output files will
     be split across multiple lines in order to ensure that each lineā€™s
     width (= number of screen columns) is less or equal to the given
     NUMBER.
ā€˜--no-wrapā€™
     Do not break long message lines.  Message lines whose width exceeds
     the output page width will not be split into several lines.  Only
     file reference lines which are wider than the output page width
     will be split.
ā€˜--sort-outputā€™
     Generate sorted output.  Note that using this option makes it much
     harder for the translator to understand each messageā€™s context.
ā€˜--sort-by-fileā€™
     Sort output by file location.
9.3.6 Informative output
------------------------
ā€˜-hā€™
ā€˜--helpā€™
     Display this help and exit.
ā€˜-Vā€™
ā€˜--versionā€™
     Output version information and exit.
9.3.7 Examples
--------------
   To extract the messages that come from the source files
ā€˜gnulib-lib/error.cā€™ and ā€˜gnulib-lib/getopt.cā€™:
     msggrep -N gnulib-lib/error.c -N gnulib-lib/getopt.c input.po
   To extract the messages that contain the string ā€œPlease specifyā€ in
the original string:
     msggrep --msgid -F -e 'Please specify' input.po
   To extract the messages that have a context specifier of either
ā€œMenu>Fileā€ or ā€œMenu>Editā€ or a submenu of them:
     msggrep --msgctxt -E -e '^Menu>(File|Edit)' input.po
   To extract the messages whose translation contains one of the strings
in the file ā€˜wordlist.txtā€™:
     msggrep --msgstr -F -f wordlist.txt input.po