transmision: upgrade 2.22 -> 2.31
[tomato.git] / release / src / router / gettext / gettext-tools / doc / msggrep.texi
blobd3b4eb8a9cce8019ec6d0348aed8d455e6c9a7b5
1 @pindex msggrep
2 @cindex @code{msggrep} program, usage
3 @example
4 msggrep [@var{option}] [@var{inputfile}]
5 @end example
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
13 @table @samp
14 @item @var{inputfile}
15 Input PO file.
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.
25 @end table
27 If no @var{inputfile} is given or if it is @samp{-}, standard input is read.
29 @subsection Output file location
31 @table @samp
32 @item -o @var{file}
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.
38 @end table
40 The results are written to standard output if no output file is specified
41 or if it is @samp{-}.
43 @subsection Message selection
45 @example
46   [-N @var{sourcefile}]... [-M @var{domainname}]...
47   [-K @var{msgid-pattern}] [-T @var{msgstr-pattern}] [-C @var{comment-pattern}]
48 @end example
50 A message is selected if
51 @itemize @bullet
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
55       @var{msgid-pattern},
56 @item or if @samp{-T} is given and its translation (msgstr) matches
57       @var{msgstr-pattern},
58 @item or if @samp{-C} is given and the translator's comment matches
59       @var{comment-pattern}.
60 @end itemize
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:
66 @example
67   [-E | -F] [-e @var{pattern} | -f @var{file}]...
68 @end example
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.
72 @table @samp
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}.
86 @item -K
87 @itemx --msgid
88 @opindex -K@r{, @code{msggrep} option}
89 @opindex --msgid@r{, @code{msggrep} option}
90 Start of patterns for the msgid.
92 @item -T
93 @itemx --msgstr
94 @opindex -T@r{, @code{msggrep} option}
95 @opindex --msgstr@r{, @code{msggrep} option}
96 Start of patterns for the msgstr.
98 @item -C
99 @itemx --comment
100 @opindex -C@r{, @code{msggrep} option}
101 @opindex --comment@r{, @code{msggrep} option}
102 Start of patterns for the translator's comment.
104 @item -E
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.
110 @item -F
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.
122 @item -f @var{file}
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}.
128 @item -i
129 @itemx --ignore-case
130 @opindex -i@r{, @code{msggrep} option}
131 @opindex --ignore-case@r{, @code{msggrep} option}
132 Ignore case distinctions.
134 @end table
136 @subsection Input file syntax
138 @table @samp
139 @item -P
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.
151 @end table
153 @subsection Output details
155 @c --no-escape and --escape omitted on purpose.  They are not useful.
157 @table @samp
158 @item --force-po
159 @opindex --force-po@r{, @code{msggrep} option}
160 Always write an output file even if it contains no message.
162 @item --indent
163 @opindex --indent@r{, @code{msggrep} option}
164 Write the .po file using indented style.
166 @item --no-location
167 @opindex --no-location@r{, @code{msggrep} option}
168 Do not write @samp{#: @var{filename}:@var{line}} lines.
170 @item --add-location
171 @opindex --add-location@r{, @code{msggrep} option}
172 Generate @samp{#: @var{filename}:@var{line}} lines (default).
174 @item --strict
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
178 GNU extensions.
180 @item -p
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
186 obsolete messages.
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}.
201 @item --no-wrap
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.
207 @item --sort-output
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.
212 @item --sort-by-file
213 @opindex --sort-by-file@r{, @code{msggrep} option}
214 Sort output by file location.
216 @end table
218 @subsection Informative output
220 @table @samp
221 @item -h
222 @itemx --help
223 @opindex -h@r{, @code{msggrep} option}
224 @opindex --help@r{, @code{msggrep} option}
225 Display this help and exit.
227 @item -V
228 @itemx --version
229 @opindex -V@r{, @code{msggrep} option}
230 @opindex --version@r{, @code{msggrep} option}
231 Output version information and exit.
233 @end table