2 @cindex @code{msggrep} program, usage
4 msggrep [@var{option}] [@var{inputfile}]
7 @cindex search messages in a catalog
8 The @code{msggrep} program extracts all messages of a translation catalog
9 that match a given pattern or belong to some given source files.
11 @subsection Input file location
17 @item -D @var{directory}
18 @itemx --directory=@var{directory}
19 @opindex -D@r{, @code{msggrep} option}
20 @opindex --directory@r{, @code{msggrep} option}
21 Add @var{directory} to the list of directories. Source files are
22 searched relative to this list of directories. The resulting @file{.po}
23 file will be written relative to the current directory, though.
27 If no @var{inputfile} is given or if it is @samp{-}, standard input is read.
29 @subsection Output file location
33 @itemx --output-file=@var{file}
34 @opindex -o@r{, @code{msggrep} option}
35 @opindex --output-file@r{, @code{msggrep} option}
36 Write output to specified file.
40 The results are written to standard output if no output file is specified
43 @subsection Message selection
46 [-N @var{sourcefile}]... [-M @var{domainname}]...
47 [-K @var{msgid-pattern}] [-T @var{msgstr-pattern}] [-C @var{comment-pattern}]
50 A message is selected if
52 @item it comes from one of the specified source files,
53 @item or if it comes from one of the specified domains,
54 @item or if @samp{-K} is given and its key (msgid or msgid_plural) matches
56 @item or if @samp{-T} is given and its translation (msgstr) matches
58 @item or if @samp{-C} is given and the translator's comment matches
59 @var{comment-pattern}.
62 When more than one selection criterion is specified, the set of selected
63 messages is the union of the selected messages of each criterion.
65 @var{msgid-pattern} or @var{msgstr-pattern} syntax:
67 [-E | -F] [-e @var{pattern} | -f @var{file}]...
69 @var{pattern}s are basic regular expressions by default, or extended regular
70 expressions if -E is given, or fixed strings if -F is given.
73 @item -N @var{sourcefile}
74 @itemx --location=@var{sourcefile}
75 @opindex -N@r{, @code{msggrep} option}
76 @opindex --location@r{, @code{msggrep} option}
77 Select messages extracted from @var{sourcefile}. @var{sourcefile} can be
78 either a literal file name or a wildcard pattern.
80 @item -M @var{domainname}
81 @itemx --domain=@var{domainname}
82 @opindex -M@r{, @code{msggrep} option}
83 @opindex --domain@r{, @code{msggrep} option}
84 Select messages belonging to domain @var{domainname}.
88 @opindex -K@r{, @code{msggrep} option}
89 @opindex --msgid@r{, @code{msggrep} option}
90 Start of patterns for the msgid.
94 @opindex -T@r{, @code{msggrep} option}
95 @opindex --msgstr@r{, @code{msggrep} option}
96 Start of patterns for the msgstr.
100 @opindex -C@r{, @code{msggrep} option}
101 @opindex --comment@r{, @code{msggrep} option}
102 Start of patterns for the translator's comment.
105 @itemx --extended-regexp
106 @opindex -E@r{, @code{msggrep} option}
107 @opindex --extended-regexp@r{, @code{msggrep} option}
108 Specify that @var{pattern} is an extended regular expression.
111 @itemx --fixed-strings
112 @opindex -F@r{, @code{msggrep} option}
113 @opindex --fixed-strings@r{, @code{msggrep} option}
114 Specify that @var{pattern} is a set of newline-separated strings.
116 @item -e @var{pattern}
117 @itemx --regexp=@var{pattern}
118 @opindex -e@r{, @code{msggrep} option}
119 @opindex --regexp=@r{, @code{msggrep} option}
120 Use @var{pattern} as a regular expression.
123 @itemx --file=@var{file}
124 @opindex -f@r{, @code{msggrep} option}
125 @opindex --file@r{, @code{msggrep} option}
126 Obtain @var{pattern} from @var{file}.
130 @opindex -i@r{, @code{msggrep} option}
131 @opindex --ignore-case@r{, @code{msggrep} option}
132 Ignore case distinctions.
136 @subsection Input file syntax
140 @itemx --properties-input
141 @opindex -P@r{, @code{msggrep} option}
142 @opindex --properties-input@r{, @code{msggrep} option}
143 Assume the input file is a Java ResourceBundle in Java @code{.properties}
144 syntax, not in PO file syntax.
146 @item --stringtable-input
147 @opindex --stringtable-input@r{, @code{msggrep} option}
148 Assume the input file is a NeXTstep/GNUstep localized resource file in
149 @code{.strings} syntax, not in PO file syntax.
153 @subsection Output details
155 @c --no-escape and --escape omitted on purpose. They are not useful.
159 @opindex --force-po@r{, @code{msggrep} option}
160 Always write an output file even if it contains no message.
163 @opindex --indent@r{, @code{msggrep} option}
164 Write the .po file using indented style.
167 @opindex --no-location@r{, @code{msggrep} option}
168 Do not write @samp{#: @var{filename}:@var{line}} lines.
171 @opindex --add-location@r{, @code{msggrep} option}
172 Generate @samp{#: @var{filename}:@var{line}} lines (default).
175 @opindex --strict@r{, @code{msggrep} option}
176 Write out a strict Uniforum conforming PO file. Note that this
177 Uniforum format should be avoided because it doesn't support the
181 @itemx --properties-output
182 @opindex -p@r{, @code{msggrep} option}
183 @opindex --properties-output@r{, @code{msggrep} option}
184 Write out a Java ResourceBundle in Java @code{.properties} syntax. Note
185 that this file format doesn't support plural forms and silently drops
188 @item --stringtable-output
189 @opindex --stringtable-output@r{, @code{msggrep} option}
190 Write out a NeXTstep/GNUstep localized resource file in @code{.strings} syntax.
191 Note that this file format doesn't support plural forms.
193 @item -w @var{number}
194 @itemx --width=@var{number}
195 @opindex -w@r{, @code{msggrep} option}
196 @opindex --width@r{, @code{msggrep} option}
197 Set the output page width. Long strings in the output files will be
198 split across multiple lines in order to ensure that each line's width
199 (= number of screen columns) is less or equal to the given @var{number}.
202 @opindex --no-wrap@r{, @code{msggrep} option}
203 Do not break long message lines. Message lines whose width exceeds the
204 output page width will not be split into several lines. Only file reference
205 lines which are wider than the output page width will be split.
208 @opindex --sort-output@r{, @code{msggrep} option}
209 Generate sorted output. Note that using this option makes it much harder
210 for the translator to understand each message's context.
213 @opindex --sort-by-file@r{, @code{msggrep} option}
214 Sort output by file location.
218 @subsection Informative output
223 @opindex -h@r{, @code{msggrep} option}
224 @opindex --help@r{, @code{msggrep} option}
225 Display this help and exit.
229 @opindex -V@r{, @code{msggrep} option}
230 @opindex --version@r{, @code{msggrep} option}
231 Output version information and exit.