Debian Codegraph @

po/pt_BR/man3/getopt.3.po

raw
1 # Brazilian Portuguese translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Felipe M Pereira <[email protected]>, 2001.
5 # André Luiz Fassone <[email protected]>, 2001.
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: manpages-l10n\n"
9 "POT-Creation-Date: 2026-06-05 06:25+0200\n"
10 "PO-Revision-Date: 2001-06-02 19:20-0300\n"
11 "Last-Translator: André Luiz Fassone <[email protected]>\n"
12 "Language-Team: Brazilian Portuguese <debian-l10n-"
13 "[email protected]>\n"
14 "Language: pt_BR\n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
19 "X-Generator: Virtaal 1.0.0-beta1\n"
20
21 #. type: TH
22 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
23 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
24 #, fuzzy, no-wrap
25 #| msgid "getopt()"
26 msgid "getopt"
27 msgstr "getopt()"
28
29 #. type: TH
30 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
31 #: opensuse-tumbleweed
32 #, no-wrap
33 msgid "2026-02-08"
34 msgstr "8 fevereiro 2026"
35
36 #. type: TH
37 #: archlinux debian-unstable
38 #, fuzzy, no-wrap
39 #| msgid "Linux man-pages 6.17"
40 msgid "Linux man-pages 6.18"
41 msgstr "Linux man-pages 6.17"
42
43 #. type: SH
44 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
45 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
46 #, no-wrap
47 msgid "NAME"
48 msgstr "NOME"
49
50 #. type: Plain text
51 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
52 #: opensuse-tumbleweed
53 #, fuzzy
54 msgid "getopt, optarg, optind, opterr, optopt - Parse command-line options"
55 msgstr ""
56 "getopt, getopt_long, getopt_long_only, optarg, optind, opterr, optopt - "
57 "analisa sintaticamente das opções da linha de comando (parsing)"
58
59 #. type: SH
60 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
61 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
62 #, no-wrap
63 msgid "LIBRARY"
64 msgstr "BIBLIOTECA"
65
66 #. type: Plain text
67 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
68 #: opensuse-leap-16-1 opensuse-tumbleweed
69 msgid "Standard C library (I<libc>,\\ I<-lc>)"
70 msgstr "Biblioteca C Padrão (I<libc>,\\ I<-lc>)"
71
72 #. type: SH
73 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
74 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
75 #, no-wrap
76 msgid "SYNOPSIS"
77 msgstr "SINOPSE"
78
79 #. type: Plain text
80 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
81 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
82 #, no-wrap
83 msgid "B<#include E<lt>unistd.hE<gt>>\n"
84 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
85
86 #. type: Plain text
87 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
88 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
89 #, fuzzy, no-wrap
90 #| msgid ""
91 #| "B<int getopt(int >I<argc>B<, char * const >I<argv[]>B<,>\n"
92 #| "B< const char *>I<optstring>B<);>\n"
93 msgid ""
94 "B<int getopt(int >I<argc>B<, char *>I<argv>B<[],>\n"
95 "B< const char *>I<optstring>B<);>\n"
96 msgstr ""
97 "B<int getopt(int >I<argc>B<, char * const >I<argv[]>B<,>\n"
98 "B< const char *>I<optstring>B<);>\n"
99
100 #. type: Plain text
101 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
102 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
103 #, no-wrap
104 msgid ""
105 "B<extern char *>I<optarg>B<;>\n"
106 "B<extern int >I<optind>B<, >I<opterr>B<, >I<optopt>B<;>\n"
107 msgstr ""
108 "B<extern char *>I<optarg>B<;>\n"
109 "B<extern int >I<optind>B<, >I<opterr>B<, >I<optopt>B<;>\n"
110
111 #. type: Plain text
112 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
113 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
114 msgid ""
115 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
116 msgstr ""
117 "Requisitos de macro de teste de recursos para o glibc (consulte "
118 "B<feature_test_macros>(7)):"
119
120 #. type: Plain text
121 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
122 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
123 msgid "B<getopt>():"
124 msgstr "B<getopt>():"
125
126 #. type: Plain text
127 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
128 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
129 #, no-wrap
130 msgid " _POSIX_C_SOURCE E<gt>= 2 || _XOPEN_SOURCE\n"
131 msgstr " _POSIX_C_SOURCE E<gt>= 2 || _XOPEN_SOURCE\n"
132
133 #. type: SH
134 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
135 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
136 #, no-wrap
137 msgid "DESCRIPTION"
138 msgstr "DESCRIÇÃO"
139
140 #. type: Plain text
141 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
142 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
143 #, fuzzy
144 #| msgid ""
145 #| "The B<getopt()> function parses the command line arguments. Its "
146 #| "arguments I<argc> and I<argv> are the argument count and array as passed "
147 #| "to the B<main()> function on program invocation. An element of I<argv> "
148 #| "that starts with `-' (and is not exactly \"-\" or \"--\") is an option "
149 #| "element. The characters of this element (aside from the initial `-') are "
150 #| "option characters. If B<getopt()> is called repeatedly, it returns "
151 #| "successively each of the option characters from each of the option "
152 #| "elements."
153 msgid ""
154 "The B<getopt>() function parses the command-line arguments. Its arguments "
155 "I<argc> and I<argv> are the argument count and array as passed to the "
156 "I<main>() function on program invocation. An element of I<argv> that "
157 "starts with \\[aq]-\\[aq] (and is not exactly \"-\" or \"--\") is an option "
158 "element. The characters of this element (aside from the initial \\[aq]-\\"
159 "[aq]) are option characters. If B<getopt>() is called repeatedly, it "
160 "returns successively each of the option characters from each of the option "
161 "elements."
162 msgstr ""
163 "A função B<getopt()> analisa os argumentos da linha de comando. Seus "
164 "argumentos I<argc> e I<argv> são, respectivamente, a contagem de argumentos "
165 "e o array como passados para a função B<main()> na invocação do programa. Um "
166 "elemento de I<argv> que inicia com '-' (e não é exatamente '-' ou '--') é um "
167 "elemento de opção. Os caracteres deste elemento (fora o '-' inicial) são "
168 "caracteres de opção. Se B<getopt()> é chamado repetidamente, ele retorna "
169 "sucessivamente cada um dos caracteres de opção de cada um dos elementos de "
170 "opção."
171
172 #. type: Plain text
173 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
174 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
175 msgid ""
176 "The variable I<optind> is the index of the next element to be processed in "
177 "I<argv>. The system initializes this value to 1. The caller can reset it "
178 "to 1 to restart scanning of the same I<argv>, or when scanning a new "
179 "argument vector."
180 msgstr ""
181
182 #. type: Plain text
183 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
184 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
185 msgid ""
186 "If B<getopt>() finds another option character, it returns that character, "
187 "updating the external variable I<optind> and a static variable I<nextchar> "
188 "so that the next call to B<getopt>() can resume the scan with the following "
189 "option character or I<argv>-element."
190 msgstr ""
191 "Se B<getopt>() encontra um outro caractere de opção, ela retorna este "
192 "caractere, atualizando a variável externa I<optind> e uma variável estática "
193 "I<nextchar> de forma que a próxima chamada a B<getopt>() pode continuar a "
194 "busca com o caractere de opção seguinte ou um elemento de I<argv>."
195
196 #. type: Plain text
197 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
198 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
199 msgid ""
200 "If there are no more option characters, B<getopt>() returns -1. Then "
201 "I<optind> is the index in I<argv> of the first I<argv>-element that is not "
202 "an option."
203 msgstr ""
204 "Se não há mais caracteres de opção, B<getopt>() retorna -1. Então I<optind> "
205 "é o índice em I<argv> do primeiro elemento de I<argv> que não é uma opção."
206
207 #. type: Plain text
208 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
209 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
210 #, fuzzy
211 #| msgid ""
212 #| "I<optstring> is a string containing the legitimate option characters. If "
213 #| "such a character is followed by a colon, the option requires an argument, "
214 #| "so B<getopt> places a pointer to the following text in the same I<argv>-"
215 #| "element, or the text of the following I<argv>-element, in I<optarg>. Two "
216 #| "colons mean an option takes an optional arg; if there is text in the "
217 #| "current I<argv>-element, it is returned in I<optarg>, otherwise I<optarg> "
218 #| "is set to zero. This is a GNU extension. If I<optstring> contains B<W> "
219 #| "followed by a semicolon, then B<-W foo> is treated as the long option B<--"
220 #| "foo>. (The B<-W> option is reserved by POSIX.2 for implementation "
221 #| "extensions.) This behaviour is a GNU extension, not available with "
222 #| "libraries before GNU libc 2."
223 msgid ""
224 "I<optstring> is a string containing the legitimate option characters. A "
225 "legitimate option character is any visible one byte B<ascii>(7) character "
226 "(for which B<isgraph>(3) would return nonzero) that is not \\[aq]-\\[aq], \\"
227 "[aq]:\\[aq], or \\[aq];\\[aq]. If such a character is followed by a colon, "
228 "the option requires an argument, so B<getopt>() places a pointer to the "
229 "following text in the same I<argv>-element, or the text of the following "
230 "I<argv>-element, in I<optarg>. Two colons mean an option takes an optional "
231 "arg; if there is text in the current I<argv>-element (i.e., in the same word "
232 "as the option name itself, for example, \"-oarg\"), then it is returned in "
233 "I<optarg>, otherwise I<optarg> is set to zero. This is a GNU extension. If "
234 "I<optstring> contains B<W> followed by a semicolon, then B<-W foo> is "
235 "treated as the long option B<--foo>. (The B<-W> option is reserved by "
236 "POSIX.2 for implementation extensions.) This behavior is a GNU extension, "
237 "not available with libraries before glibc 2."
238 msgstr ""
239 "I<optstring> é uma string contendo os caracteres de opção legítimos. Se tal "
240 "caractere é seguido por dois-pontos, a opção requer um argumento, então "
241 "B<getopt> atribui um ponteiro para o texto que segue no mesmo elemento de "
242 "I<argv>, ou para o texto do elemento seguinte de I<argv>, em I<optarg>. Dois "
243 "dois-pontos significam que uma opção recebe um argumento opcional; se há "
244 "texto no elemento de I<argv> atual, ele é retornado em I<optarg>, caso "
245 "contrário I<optarg> é zerado. Esta é uma extensão GNU. Se I<optstring> "
246 "contém B<W> seguido de um ponto-e-vírgula, então B<-W foo> é tratado como a "
247 "opção longa B<--foo>. (A opção B<-W> é reservada pelo POSIX.2 para extensões "
248 "de implementação.) Este comportamento é uma extensão GNU, não disponível em "
249 "bibliotecas anteriores à GNU libc 2."
250
251 #. type: Plain text
252 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
253 #: opensuse-tumbleweed
254 #, fuzzy
255 #| msgid ""
256 #| "By default, B<getopt()> permutes the contents of I<argv> as it scans, so "
257 #| "that eventually all the non-options are at the end. Two other modes are "
258 #| "also implemented. If the first character of I<optstring> is `+' or the "
259 #| "environment variable POSIXLY_CORRECT is set, then option processing stops "
260 #| "as soon as a non-option argument is encountered. If the first character "
261 #| "of I<optstring> is `-', then each non-option I<argv>-element is handled "
262 #| "as if it were the argument of an option with character code 1. (This is "
263 #| "used by programs that were written to expect options and other I<argv>-"
264 #| "elements in any order and that care about the ordering of the two.) The "
265 #| "special argument `--' forces an end of option-scanning regardless of the "
266 #| "scanning mode."
267 msgid ""
268 "By default, B<getopt>() permutes the contents of I<argv> as it scans, so "
269 "that eventually all the nonoptions are at the end. Two other scanning modes "
270 "are also implemented. If the first character of I<optstring> is \\[aq]+\\"
271 "[aq] or the environment variable B<\\%POSIXLY_CORRECT> is set, then option "
272 "processing stops as soon as a nonoption argument is encountered. If \\[aq]+"
273 "\\[aq] is not the first character of I<optstring>, it is treated as a normal "
274 "option. If B<\\%POSIXLY_CORRECT> behavior is required in this case "
275 "I<optstring> will contain two \\[aq]+\\[aq] symbols. If the first character "
276 "of I<optstring> is \\[aq]-\\[aq], then each nonoption I<argv>-element is "
277 "handled as if it were the argument of an option with character code 1. "
278 "(This is used by programs that were written to expect options and other "
279 "I<argv>-elements in any order and that care about the ordering of the two.) "
280 "The special argument \"--\" forces an end of option-scanning regardless of "
281 "the scanning mode."
282 msgstr ""
283 "Por padrão, B<getopt()> permuta o conteúdo de I<argv> enquanto realiza a "
284 "busca, de forma que finalmente todas as não-opções estão no fim. Dois outros "
285 "modos são também implementados. Se o primeiro caractere de I<optstring> é "
286 "'+' ou a variável de ambiente POSIXLY_CORRECT está ligada, então o "
287 "processamento de opções para tão logo um argumento que não é uma opção é "
288 "encontrado. Se o primeiro caractere de I<optstring> é '-', então cada "
289 "elemento de I<argv> que não é uma opção é tratado como se fosse um argumento "
290 "de uma opção com código de caractere 1. (Isto é usado por programas que "
291 "foram escritos para esperar opções e outros elementos de I<argv> em qualquer "
292 "ordem e que se importam com a ordem dos dois.) O argumento especial '--' "
293 "força um fim de busca de opções independentemente do modo de busca."
294
295 #. type: Plain text
296 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
297 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
298 msgid ""
299 "While processing the option list, B<getopt>() can detect two kinds of "
300 "errors: (1) an option character that was not specified in I<optstring> and "
301 "(2) a missing option argument (i.e., an option at the end of the command "
302 "line without an expected argument). Such errors are handled and reported as "
303 "follows:"
304 msgstr ""
305
306 #. type: IP
307 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
308 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
309 #, no-wrap
310 msgid "\\[bu]"
311 msgstr "\\[bu]"
312
313 #. type: Plain text
314 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
315 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
316 msgid ""
317 "By default, B<getopt>() prints an error message on standard error, places "
318 "the erroneous option character in I<optopt>, and returns \\[aq]?\\[aq] as "
319 "the function result."
320 msgstr ""
321
322 #. type: Plain text
323 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
324 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
325 msgid ""
326 "If the caller has set the global variable I<opterr> to zero, then "
327 "B<getopt>() does not print an error message. The caller can determine that "
328 "there was an error by testing whether the function return value is \\[aq]?\\"
329 "[aq]. (By default, I<opterr> has a nonzero value.)"
330 msgstr ""
331
332 #. type: Plain text
333 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
334 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
335 msgid ""
336 "If the first character (following any optional \\[aq]+\\[aq] or \\[aq]-\\"
337 "[aq] described above) of I<optstring> is a colon (\\[aq]:\\[aq]), then "
338 "B<getopt>() likewise does not print an error message. In addition, it "
339 "returns \\[aq]:\\[aq] instead of \\[aq]?\\[aq] to indicate a missing option "
340 "argument. This allows the caller to distinguish the two different types of "
341 "errors."
342 msgstr ""
343
344 #. type: SH
345 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
346 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
347 #, no-wrap
348 msgid "RETURN VALUE"
349 msgstr "VALOR DE RETORNO"
350
351 #. type: Plain text
352 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
353 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
354 msgid ""
355 "If an option was successfully found, then B<getopt>() returns the option "
356 "character. If all command-line options have been parsed, then B<getopt>() "
357 "returns -1. If B<getopt>() encounters an option character that was not in "
358 "I<optstring>, then \\[aq]?\\[aq] is returned. If B<getopt>() encounters an "
359 "option with a missing argument, then the return value depends on the first "
360 "character in I<optstring>: if it is \\[aq]:\\[aq], then \\[aq]:\\[aq] is "
361 "returned; otherwise \\[aq]?\\[aq] is returned."
362 msgstr ""
363
364 #. type: SH
365 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
366 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
367 #, no-wrap
368 msgid "ENVIRONMENT"
369 msgstr "AMBIENTE"
370
371 #. type: TP
372 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
373 #: opensuse-tumbleweed
374 #, fuzzy, no-wrap
375 #| msgid "B<POSIXLY_CORRECT>"
376 msgid "B<\\%POSIXLY_CORRECT>"
377 msgstr "B<POSIXLY_CORRECT>"
378
379 #. type: Plain text
380 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
381 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
382 msgid ""
383 "If this is set, then option processing stops as soon as a nonoption argument "
384 "is encountered."
385 msgstr ""
386 "Se ligada, então o processamento de opção para tão logo um argumento que não "
387 "é uma opção seja encontrado."
388
389 #. type: SH
390 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
391 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
392 #, no-wrap
393 msgid "ATTRIBUTES"
394 msgstr "ATRIBUTOS"
395
396 #. type: Plain text
397 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
398 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
399 msgid ""
400 "For an explanation of the terms used in this section, see B<attributes>(7)."
401 msgstr ""
402 "Para uma explicação dos termos usados nesta seção, consulte B<attributes>(7)."
403
404 #. type: tbl table
405 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
406 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
407 #, no-wrap
408 msgid "Interface"
409 msgstr "Interface"
410
411 #. type: tbl table
412 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
413 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
414 #, no-wrap
415 msgid "Attribute"
416 msgstr "Atributo"
417
418 #. type: tbl table
419 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
420 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
421 #, no-wrap
422 msgid "Value"
423 msgstr "Valor"
424
425 #. type: tbl table
426 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
427 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
428 #, no-wrap
429 msgid ".na\n"
430 msgstr ".na\n"
431
432 #. type: tbl table
433 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
434 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
435 #, no-wrap
436 msgid ".nh\n"
437 msgstr ".nh\n"
438
439 #. type: TP
440 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
441 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
442 #, fuzzy, no-wrap
443 #| msgid "B<getopt>():"
444 msgid "B<getopt>()"
445 msgstr "B<getopt>():"
446
447 #. type: tbl table
448 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
449 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
450 #, no-wrap
451 msgid "Thread safety"
452 msgstr "Thread safety"
453
454 #. type: tbl table
455 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
456 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
457 #, no-wrap
458 msgid "MT-Unsafe race:getopt env"
459 msgstr ""
460
461 #. type: SH
462 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
463 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
464 #, no-wrap
465 msgid "VERSIONS"
466 msgstr "VERSÕES"
467
468 #. type: Plain text
469 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
470 #: opensuse-tumbleweed
471 msgid ""
472 "POSIX specifies that the I<argv> array argument should be I<const>, but "
473 "these functions permute its elements unless the environment variable B<\\"
474 "%POSIXLY_CORRECT> is set. I<const> is used in the actual prototype to be "
475 "compatible with other systems; however, this page doesn't show the "
476 "qualifier, to avoid confusing readers."
477 msgstr ""
478
479 #. type: SH
480 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
481 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
482 #, no-wrap
483 msgid "STANDARDS"
484 msgstr "PADRÕES"
485
486 #. type: Plain text
487 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
488 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
489 msgid "POSIX.1-2008."
490 msgstr "POSIX.1-2008."
491
492 #. type: Plain text
493 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
494 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
495 msgid ""
496 "The use of \\[aq]+\\[aq] and \\[aq]-\\[aq] in I<optstring> is a GNU "
497 "extension."
498 msgstr ""
499
500 #. type: SH
501 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
502 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
503 #, no-wrap
504 msgid "HISTORY"
505 msgstr "HISTÓRICO"
506
507 #. type: Plain text
508 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
509 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
510 #, fuzzy
511 #| msgid "POSIX.1-2001, POSIX.1-2008."
512 msgid "POSIX.1-2001, and POSIX.2."
513 msgstr "POSIX.1-2001, POSIX.1-2008."
514
515 #. type: Plain text
516 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
517 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
518 msgid ""
519 "On some older implementations, B<getopt>() was declared in "
520 "I<E<lt>stdio.hE<gt>>. SUSv1 permitted the declaration to appear in either "
521 "I<E<lt>unistd.hE<gt>> or I<E<lt>stdio.hE<gt>>. POSIX.1-1996 marked the use "
522 "of I<E<lt>stdio.hE<gt>> for this purpose as LEGACY. POSIX.1-2001 does not "
523 "require the declaration to appear in I<E<lt>stdio.hE<gt>>."
524 msgstr ""
525
526 #. type: Plain text
527 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
528 #: opensuse-tumbleweed
529 msgid ""
530 "Very old versions of glibc were affected by a E<.UR https:\\://"
531 "\\:sourceware.org/\\:git/\\:?"
532 "p=glibc.git;a=commitdiff;h=bf079e19f50d64aa5e05> B<\\"
533 "%_>I<PID>B<_GNU_nonoption_argv_flags_> environment variable E<.UE .>"
534 msgstr ""
535
536 #. type: SH
537 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
538 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
539 #, no-wrap
540 msgid "NOTES"
541 msgstr "NOTAS"
542
543 #. type: Plain text
544 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
545 #: opensuse-tumbleweed
546 msgid ""
547 "A program that scans multiple argument vectors, or rescans the same vector "
548 "more than once, and wants to make use of GNU extensions such as \\[aq]+\\"
549 "[aq] and \\[aq]-\\[aq] at the start of I<optstring>, or changes the value of "
550 "B<\\%POSIXLY_CORRECT> between scans, must reinitialize B<getopt>() by "
551 "resetting I<optind> to 0, rather than the traditional value of 1. "
552 "(Resetting to 0 forces the invocation of an internal initialization routine "
553 "that rechecks B<\\%POSIXLY_CORRECT> and checks for GNU extensions in "
554 "I<optstring>.)"
555 msgstr ""
556
557 #. type: Plain text
558 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
559 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
560 msgid ""
561 "Command-line arguments are parsed in strict order meaning that an option "
562 "requiring an argument will consume the next argument, regardless of whether "
563 "that argument is the correctly specified option argument or simply the next "
564 "option (in the scenario the user mis-specifies the command line). For "
565 "example, if I<optstring> is specified as \"1n:\" and the user specifies the "
566 "command line arguments incorrectly as I<prog\\ -n\\ -1>, the I<-n> option "
567 "will be given the B<optarg> value \"-1\", and the I<-1> option will be "
568 "considered to have not been specified."
569 msgstr ""
570
571 #. type: SH
572 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
573 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
574 #, no-wrap
575 msgid "EXAMPLES"
576 msgstr "EXEMPLOS"
577
578 #. type: SS
579 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
580 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
581 #, no-wrap
582 msgid "getopt()"
583 msgstr "getopt()"
584
585 #. type: Plain text
586 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
587 #: opensuse-tumbleweed
588 msgid ""
589 "The following trivial example program uses B<getopt>() to handle two "
590 "program options: I<-n>, with no associated value; and I<-t\\ val>, which "
591 "expects an associated value."
592 msgstr ""
593
594 #. type: Plain text
595 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
596 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
597 #, no-wrap
598 msgid ""
599 "#include E<lt>stdio.hE<gt>\n"
600 "#include E<lt>stdlib.hE<gt>\n"
601 "#include E<lt>unistd.hE<gt>\n"
602 "\\&\n"
603 "int\n"
604 "main(int argc, char *argv[])\n"
605 "{\n"
606 " int flags, opt;\n"
607 " int nsecs, tfnd;\n"
608 "\\&\n"
609 " nsecs = 0;\n"
610 " tfnd = 0;\n"
611 " flags = 0;\n"
612 " while ((opt = getopt(argc, argv, \"nt:\")) != -1) {\n"
613 " switch (opt) {\n"
614 " case \\[aq]n\\[aq]:\n"
615 " flags = 1;\n"
616 " break;\n"
617 " case \\[aq]t\\[aq]:\n"
618 " nsecs = atoi(optarg);\n"
619 " tfnd = 1;\n"
620 " break;\n"
621 " default: /* \\[aq]?\\[aq] */\n"
622 " fprintf(stderr, \"Usage: %s [-t nsecs] [-n] name\\[rs]n\",\n"
623 " argv[0]);\n"
624 " exit(EXIT_FAILURE);\n"
625 " }\n"
626 " }\n"
627 "\\&\n"
628 " printf(\"flags=%d; tfnd=%d; nsecs=%d; optind=%d\\[rs]n\",\n"
629 " flags, tfnd, nsecs, optind);\n"
630 "\\&\n"
631 " if (optind E<gt>= argc) {\n"
632 " fprintf(stderr, \"Expected argument after options\\[rs]n\");\n"
633 " exit(EXIT_FAILURE);\n"
634 " }\n"
635 "\\&\n"
636 " printf(\"name argument = %s\\[rs]n\", argv[optind]);\n"
637 "\\&\n"
638 " /* Other code omitted */\n"
639 "\\&\n"
640 " exit(EXIT_SUCCESS);\n"
641 "}\n"
642 msgstr ""
643
644 #. SRC END
645 #. type: SH
646 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
647 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
648 #, no-wrap
649 msgid "SEE ALSO"
650 msgstr "VEJA TAMBÉM"
651
652 #. type: Plain text
653 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
654 #: opensuse-tumbleweed
655 #, fuzzy
656 #| msgid ""
657 #| "B<getopt>(),\n"
658 #| "B<getopt_long>(),\n"
659 #| "B<getopt_long_only>()"
660 msgid ""
661 "B<getopt>(1), B<getopt_long>(3), B<getopt_long_only>(3), B<getsubopt>(3)"
662 msgstr ""
663 "B<getopt>(),\n"
664 "B<getopt_long>(),\n"
665 "B<getopt_long_only>()"
666
667 #. type: TH
668 #: debian-trixie
669 #, no-wrap
670 msgid "2024-06-15"
671 msgstr "15 junho 2024"
672
673 #. type: TH
674 #: debian-trixie
675 #, no-wrap
676 msgid "Linux man-pages 6.9.1"
677 msgstr "Linux man-pages 6.9.1"
678
679 #. type: Plain text
680 #: debian-trixie fedora-44 fedora-rawhide
681 #, fuzzy
682 msgid ""
683 "getopt, getopt_long, getopt_long_only, optarg, optind, opterr, optopt - "
684 "Parse command-line options"
685 msgstr ""
686 "getopt, getopt_long, getopt_long_only, optarg, optind, opterr, optopt - "
687 "analisa sintaticamente das opções da linha de comando (parsing)"
688
689 #. type: Plain text
690 #: debian-trixie
691 msgid "Standard C library (I<libc>, I<-lc>)"
692 msgstr "Biblioteca C Padrão (I<libc>, I<-lc>)"
693
694 #. type: Plain text
695 #: debian-trixie fedora-44 fedora-rawhide
696 #, no-wrap
697 msgid "B<#include E<lt>getopt.hE<gt>>\n"
698 msgstr "B<#include E<lt>getopt.hE<gt>>\n"
699
700 #. type: Plain text
701 #: debian-trixie fedora-44 fedora-rawhide
702 #, fuzzy, no-wrap
703 #| msgid ""
704 #| "B<int getopt_long_only(int >I<argc>B<, char * const >I<argv[]>B<,>\n"
705 #| "B< const char *>I<optstring>B<,>\n"
706 #| "B< const struct option *>I<longopts>B<, int *>I<longindex>B<);>\n"
707 msgid ""
708 "B<int getopt_long(int >I<argc>B<, char *>I<argv>B<[],>\n"
709 "B< const char *>I<optstring>B<,>\n"
710 "B< const struct option *>I<longopts>B<, int *>I<longindex>B<);>\n"
711 "B<int getopt_long_only(int >I<argc>B<, char *>I<argv>B<[],>\n"
712 "B< const char *>I<optstring>B<,>\n"
713 "B< const struct option *>I<longopts>B<, int *>I<longindex>B<);>\n"
714 msgstr ""
715 "B<int getopt_long_only(int >I<argc>B<, char * const >I<argv[]>B<,>\n"
716 "B< const char *>I<optstring>B<,>\n"
717 "B< const struct option *>I<longopts>B<, int *>I<longindex>B<);>\n"
718
719 #. type: Plain text
720 #: debian-trixie fedora-44 fedora-rawhide
721 #, fuzzy
722 #| msgid "B<getopt_long>() and B<getopt_long_only>():"
723 msgid "B<getopt_long>(), B<getopt_long_only>():"
724 msgstr "B<getopt_long>() e B<getopt_long_only>():"
725
726 #. type: Plain text
727 #: debian-trixie fedora-44 fedora-rawhide
728 #, no-wrap
729 msgid " _GNU_SOURCE\n"
730 msgstr " _GNU_SOURCE\n"
731
732 #. type: Plain text
733 #: debian-trixie fedora-44 fedora-rawhide
734 #, fuzzy
735 #| msgid ""
736 #| "By default, B<getopt()> permutes the contents of I<argv> as it scans, so "
737 #| "that eventually all the non-options are at the end. Two other modes are "
738 #| "also implemented. If the first character of I<optstring> is `+' or the "
739 #| "environment variable POSIXLY_CORRECT is set, then option processing stops "
740 #| "as soon as a non-option argument is encountered. If the first character "
741 #| "of I<optstring> is `-', then each non-option I<argv>-element is handled "
742 #| "as if it were the argument of an option with character code 1. (This is "
743 #| "used by programs that were written to expect options and other I<argv>-"
744 #| "elements in any order and that care about the ordering of the two.) The "
745 #| "special argument `--' forces an end of option-scanning regardless of the "
746 #| "scanning mode."
747 msgid ""
748 "By default, B<getopt>() permutes the contents of I<argv> as it scans, so "
749 "that eventually all the nonoptions are at the end. Two other scanning modes "
750 "are also implemented. If the first character of I<optstring> is \\[aq]+\\"
751 "[aq] or the environment variable B<POSIXLY_CORRECT> is set, then option "
752 "processing stops as soon as a nonoption argument is encountered. If \\[aq]+"
753 "\\[aq] is not the first character of I<optstring>, it is treated as a normal "
754 "option. If B<POSIXLY_CORRECT> behaviour is required in this case "
755 "I<optstring> will contain two \\[aq]+\\[aq] symbols. If the first character "
756 "of I<optstring> is \\[aq]-\\[aq], then each nonoption I<argv>-element is "
757 "handled as if it were the argument of an option with character code 1. "
758 "(This is used by programs that were written to expect options and other "
759 "I<argv>-elements in any order and that care about the ordering of the two.) "
760 "The special argument \"--\" forces an end of option-scanning regardless of "
761 "the scanning mode."
762 msgstr ""
763 "Por padrão, B<getopt()> permuta o conteúdo de I<argv> enquanto realiza a "
764 "busca, de forma que finalmente todas as não-opções estão no fim. Dois outros "
765 "modos são também implementados. Se o primeiro caractere de I<optstring> é "
766 "'+' ou a variável de ambiente POSIXLY_CORRECT está ligada, então o "
767 "processamento de opções para tão logo um argumento que não é uma opção é "
768 "encontrado. Se o primeiro caractere de I<optstring> é '-', então cada "
769 "elemento de I<argv> que não é uma opção é tratado como se fosse um argumento "
770 "de uma opção com código de caractere 1. (Isto é usado por programas que "
771 "foram escritos para esperar opções e outros elementos de I<argv> em qualquer "
772 "ordem e que se importam com a ordem dos dois.) O argumento especial '--' "
773 "força um fim de busca de opções independentemente do modo de busca."
774
775 #. type: SS
776 #: debian-trixie fedora-44 fedora-rawhide
777 #, no-wrap
778 msgid "getopt_long() and getopt_long_only()"
779 msgstr "getopt_long() e getopt_long_only()"
780
781 #. type: Plain text
782 #: debian-trixie fedora-44 fedora-rawhide
783 #, fuzzy
784 #| msgid ""
785 #| "The B<getopt_long()> function works like B<getopt()> except that it also "
786 #| "accepts long options, started out by two dashes. Long option names may "
787 #| "be abbreviated if the abbreviation is unique or is an exact match for "
788 #| "some defined option. A long option may take a parameter, of the form B<--"
789 #| "arg=param> or B<--arg param>."
790 msgid ""
791 "The B<getopt_long>() function works like B<getopt>() except that it also "
792 "accepts long options, started with two dashes. (If the program accepts only "
793 "long options, then I<optstring> should be specified as an empty string "
794 "(\"\"), not NULL.) Long option names may be abbreviated if the abbreviation "
795 "is unique or is an exact match for some defined option. A long option may "
796 "take a parameter, of the form B<--arg=param> or B<--arg param>."
797 msgstr ""
798 "A função B<getopt_long()> funciona como B<getopt()> exceto que ele também "
799 "aceita opções longas, iniciadas por dois traços. Nomes de opções longas "
800 "podem ser abreviados se a abreviação for única ou se iguala exatamente "
801 "àlguma opção definida. Uma opção longa pode recer um parâmetro da forma B<--"
802 "arg=param> ou B<--arg param>."
803
804 #. type: Plain text
805 #: debian-trixie fedora-44 fedora-rawhide
806 msgid ""
807 "I<longopts> is a pointer to the first element of an array of I<struct "
808 "option> declared in I<E<lt>getopt.hE<gt>> as"
809 msgstr ""
810 "I<longopts> é um ponteiro para o primeiro elemento de um array de I<struct "
811 "option> declarado em I<E<lt>getopt.hE<gt>> como"
812
813 #. type: Plain text
814 #: debian-trixie fedora-44 fedora-rawhide
815 #, no-wrap
816 msgid ""
817 "struct option {\n"
818 " const char *name;\n"
819 " int has_arg;\n"
820 " int *flag;\n"
821 " int val;\n"
822 "};\n"
823 msgstr ""
824 "struct option {\n"
825 " const char *name;\n"
826 " int has_arg;\n"
827 " int *flag;\n"
828 " int val;\n"
829 "};\n"
830
831 #. type: Plain text
832 #: debian-trixie fedora-44 fedora-rawhide
833 msgid "The meanings of the different fields are:"
834 msgstr "Os significados dos diferentes campos são:"
835
836 #. type: TP
837 #: debian-trixie fedora-44 fedora-rawhide
838 #, no-wrap
839 msgid "I<name>"
840 msgstr "I<nome>"
841
842 #. type: Plain text
843 #: debian-trixie fedora-44 fedora-rawhide
844 msgid "is the name of the long option."
845 msgstr "é o nome da opção longa."
846
847 #. type: TP
848 #: debian-trixie fedora-44 fedora-rawhide
849 #, no-wrap
850 msgid "I<has_arg>"
851 msgstr "I<has_arg>"
852
853 #. type: Plain text
854 #: debian-trixie fedora-44 fedora-rawhide
855 msgid ""
856 "is: B<no_argument> (or 0) if the option does not take an argument; "
857 "B<required_argument> (or 1) if the option requires an argument; or "
858 "B<optional_argument> (or 2) if the option takes an optional argument."
859 msgstr ""
860 "é: B<no_argument> (ou 0) se a opção não recebe um argumento; "
861 "B<required_argument> (ou 1) se a opção requer um argumento; ou "
862 "B<optional_argument> (ou 2) se a opção recebe um argumento opcional."
863
864 #. type: TP
865 #: debian-trixie fedora-44 fedora-rawhide
866 #, no-wrap
867 msgid "I<flag>"
868 msgstr "I<flag>"
869
870 #. type: Plain text
871 #: debian-trixie fedora-44 fedora-rawhide
872 msgid ""
873 "specifies how results are returned for a long option. If I<flag> is NULL, "
874 "then B<getopt_long>() returns I<val>. (For example, the calling program "
875 "may set I<val> to the equivalent short option character.) Otherwise, "
876 "B<getopt_long>() returns 0, and I<flag> points to a variable which is set "
877 "to I<val> if the option is found, but left unchanged if the option is not "
878 "found."
879 msgstr ""
880 "especifica como os resultados são retornados para uma opção longa. Se "
881 "I<flag> é NULO, então B<getopt_long>() retorna I<val>. (Por exemplo, o "
882 "programa chamador pode ajustar I<val> para o caractere de opção curta "
883 "equivalente.) Caso contrário, B<getopt_long>() retorna 0, e I<flag> aponta "
884 "para uma variável a qual é ajustada para I<val> se a opção é encontrada, mas "
885 "deixada intocada se a opção não é encontrada. "
886
887 #. type: TP
888 #: debian-trixie fedora-44 fedora-rawhide
889 #, no-wrap
890 msgid "I<val>"
891 msgstr "I<val>"
892
893 #. type: Plain text
894 #: debian-trixie fedora-44 fedora-rawhide
895 msgid ""
896 "is the value to return, or to load into the variable pointed to by I<flag>."
897 msgstr ""
898 "é o valor a retornar, ou a carregar para a variável apontada por I<flag>."
899
900 #. type: Plain text
901 #: debian-trixie fedora-44 fedora-rawhide
902 msgid "The last element of the array has to be filled with zeros."
903 msgstr "O último elemento do array tem que ser preenchido com zeros."
904
905 #. type: Plain text
906 #: debian-trixie fedora-44 fedora-rawhide
907 msgid ""
908 "If I<longindex> is not NULL, it points to a variable which is set to the "
909 "index of the long option relative to I<longopts>."
910 msgstr ""
911 "Se I<longindex> não é NULO, aponta para uma variável a qual é ajustada para "
912 "o índice da opção longa relativa a I<longopts>."
913
914 #. type: Plain text
915 #: debian-trixie fedora-44 fedora-rawhide
916 #, fuzzy
917 #| msgid ""
918 #| "B<getopt_long_only()> is like B<getopt_long()>, but `-' as well as `--' "
919 #| "can indicate a long option. If an option that starts with `-' (not `--') "
920 #| "doesn't match a long option, but does match a short option, it is parsed "
921 #| "as a short option instead."
922 msgid ""
923 "B<getopt_long_only>() is like B<getopt_long>(), but \\[aq]-\\[aq] as well "
924 "as \"--\" can indicate a long option. If an option that starts with \\[aq]-"
925 "\\[aq] (not \"--\") doesn't match a long option, but does match a short "
926 "option, it is parsed as a short option instead."
927 msgstr ""
928 "B<getopt_long_only()> é como B<getopt_long()>, mas tanto '-' como '--' podem "
929 "indicar uma opção longa. Se uma opção que começa com '-' (não '--') não for "
930 "igual a uma opção longa, mas é igual a uma opção curta, ela é interpretada "
931 "como uma opção curta."
932
933 #. type: Plain text
934 #: debian-trixie fedora-44 fedora-rawhide
935 #, fuzzy
936 #| msgid ""
937 #| "B<getopt_long()> and B<getopt_long_only()> also return the option "
938 #| "character when a short option is recognized. For a long option, they "
939 #| "return I<val> if I<flag> is B<NULL>, and 0 otherwise. Error and -1 "
940 #| "returns are the same as for B<getopt()>, plus `?' for an ambiguous match "
941 #| "or an extraneous parameter."
942 msgid ""
943 "B<getopt_long>() and B<getopt_long_only>() also return the option "
944 "character when a short option is recognized. For a long option, they return "
945 "I<val> if I<flag> is NULL, and 0 otherwise. Error and -1 returns are the "
946 "same as for B<getopt>(), plus \\[aq]?\\[aq] for an ambiguous match or an "
947 "extraneous parameter."
948 msgstr ""
949 "B<getopt_long()> e B<getopt_long_only()> também retornam o caractere de "
950 "opção quando uma opção curta é reconhecida. Para uma opção longa, elas "
951 "retornam I<val> se I<flag> é B<NULO>, e 0 caso contrário. Retornos de erro e "
952 "de -1 significam o mesmo que para B<getopt()>, mais '?' para opção ambígua "
953 "ou um parâmetro estranho."
954
955 #. type: TP
956 #: debian-trixie fedora-44 fedora-rawhide
957 #, no-wrap
958 msgid "B<POSIXLY_CORRECT>"
959 msgstr "B<POSIXLY_CORRECT>"
960
961 #. type: TP
962 #: debian-trixie
963 #, no-wrap
964 msgid "B<_E<lt>PIDE<gt>_GNU_nonoption_argv_flags_>"
965 msgstr "B<_E<lt>PIDE<gt>_GNU_nonoption_argv_flags_>"
966
967 #. type: Plain text
968 #: debian-trixie
969 #, fuzzy
970 #| msgid ""
971 #| "This variable was used by B<bash>(1) 2.0 to communicate to glibc which "
972 #| "arguments are the results of wildcard expansion and so should not be "
973 #| "considered as options. This behavior was removed in B<bash>(1) version "
974 #| "2.01, but the support remains in glibc."
975 msgid ""
976 "This variable was used by B<bash>(1) 2.0 to communicate to glibc which "
977 "arguments are the results of wildcard expansion and so should not be "
978 "considered as options. This behavior was removed in B<bash>(1) 2.01, but "
979 "the support remains in glibc."
980 msgstr ""
981 "Esta variável foi usada pelo programa B<bash>(1) 2.0 para comunicar à glibc "
982 "quais argumentos são os resultados da expansão de coringas e portanto não "
983 "deveriam ser considerados como opções. Este comportamente foi removido no "
984 "B<bash>(1) versão 2.01, mas o suporte foi mantido na glibc."
985
986 #. type: tbl table
987 #: debian-trixie fedora-44 fedora-rawhide
988 #, no-wrap
989 msgid ""
990 "B<getopt>(),\n"
991 "B<getopt_long>(),\n"
992 "B<getopt_long_only>()"
993 msgstr ""
994 "B<getopt>(),\n"
995 "B<getopt_long>(),\n"
996 "B<getopt_long_only>()"
997
998 #. type: Plain text
999 #: debian-trixie fedora-44 fedora-rawhide
1000 msgid ""
1001 "POSIX specifies that the I<argv> array argument should be I<const>, but "
1002 "these functions permute its elements unless the environment variable "
1003 "B<POSIXLY_CORRECT> is set. I<const> is used in the actual prototype to be "
1004 "compatible with other systems; however, this page doesn't show the "
1005 "qualifier, to avoid confusing readers."
1006 msgstr ""
1007
1008 #. type: TP
1009 #: debian-trixie fedora-44 fedora-rawhide
1010 #, fuzzy, no-wrap
1011 #| msgid "getopt_long()"
1012 msgid "B<getopt_long>()"
1013 msgstr "getopt_long()"
1014
1015 #. type: TQ
1016 #: debian-trixie fedora-44 fedora-rawhide
1017 #, fuzzy, no-wrap
1018 #| msgid "getopt_long()"
1019 msgid "B<getopt_long_only>()"
1020 msgstr "getopt_long()"
1021
1022 #. type: Plain text
1023 #: debian-trixie fedora-44 fedora-rawhide
1024 msgid "GNU."
1025 msgstr "GNU."
1026
1027 #. type: Plain text
1028 #: debian-trixie fedora-44 fedora-rawhide
1029 msgid ""
1030 "A program that scans multiple argument vectors, or rescans the same vector "
1031 "more than once, and wants to make use of GNU extensions such as \\[aq]+\\"
1032 "[aq] and \\[aq]-\\[aq] at the start of I<optstring>, or changes the value of "
1033 "B<POSIXLY_CORRECT> between scans, must reinitialize B<getopt>() by "
1034 "resetting I<optind> to 0, rather than the traditional value of 1. "
1035 "(Resetting to 0 forces the invocation of an internal initialization routine "
1036 "that rechecks B<POSIXLY_CORRECT> and checks for GNU extensions in "
1037 "I<optstring>.)"
1038 msgstr ""
1039
1040 #. type: Plain text
1041 #: debian-trixie fedora-44 fedora-rawhide
1042 msgid ""
1043 "The following trivial example program uses B<getopt>() to handle two "
1044 "program options: I<-n>, with no associated value; and I<-t val>, which "
1045 "expects an associated value."
1046 msgstr ""
1047
1048 #. SRC END
1049 #. type: SS
1050 #: debian-trixie fedora-44 fedora-rawhide
1051 #, no-wrap
1052 msgid "getopt_long()"
1053 msgstr "getopt_long()"
1054
1055 #. type: Plain text
1056 #: debian-trixie fedora-44 fedora-rawhide
1057 msgid ""
1058 "The following example program illustrates the use of B<getopt_long>() with "
1059 "most of its features."
1060 msgstr ""
1061 "O seguinte programa exemplo do código fonte, ilustra o uso de "
1062 "B<getopt_long>() com a maioria de seus recursos."
1063
1064 #. type: Plain text
1065 #: debian-trixie fedora-44 fedora-rawhide
1066 #, no-wrap
1067 msgid ""
1068 "#include E<lt>getopt.hE<gt>\n"
1069 "#include E<lt>stdio.hE<gt> /* for printf */\n"
1070 "#include E<lt>stdlib.hE<gt> /* for exit */\n"
1071 "\\&\n"
1072 "int\n"
1073 "main(int argc, char *argv[])\n"
1074 "{\n"
1075 " int c;\n"
1076 " int digit_optind = 0;\n"
1077 "\\&\n"
1078 " while (1) {\n"
1079 " int this_option_optind = optind ? optind : 1;\n"
1080 " int option_index = 0;\n"
1081 " static struct option long_options[] = {\n"
1082 " {\"add\", required_argument, 0, 0 },\n"
1083 " {\"append\", no_argument, 0, 0 },\n"
1084 " {\"delete\", required_argument, 0, 0 },\n"
1085 " {\"verbose\", no_argument, 0, 0 },\n"
1086 " {\"create\", required_argument, 0, \\[aq]c\\[aq]},\n"
1087 " {\"file\", required_argument, 0, 0 },\n"
1088 " {0, 0, 0, 0 }\n"
1089 " };\n"
1090 "\\&\n"
1091 " c = getopt_long(argc, argv, \"abc:d:012\",\n"
1092 " long_options, &option_index);\n"
1093 " if (c == -1)\n"
1094 " break;\n"
1095 "\\&\n"
1096 " switch (c) {\n"
1097 " case 0:\n"
1098 " printf(\"option %s\", long_options[option_index].name);\n"
1099 " if (optarg)\n"
1100 " printf(\" with arg %s\", optarg);\n"
1101 " printf(\"\\[rs]n\");\n"
1102 " break;\n"
1103 "\\&\n"
1104 " case \\[aq]0\\[aq]:\n"
1105 " case \\[aq]1\\[aq]:\n"
1106 " case \\[aq]2\\[aq]:\n"
1107 " if (digit_optind != 0 && digit_optind != this_option_optind)\n"
1108 " printf(\"digits occur in two different argv-elements.\\[rs]n\");\n"
1109 " digit_optind = this_option_optind;\n"
1110 " printf(\"option %c\\[rs]n\", c);\n"
1111 " break;\n"
1112 "\\&\n"
1113 " case \\[aq]a\\[aq]:\n"
1114 " printf(\"option a\\[rs]n\");\n"
1115 " break;\n"
1116 "\\&\n"
1117 " case \\[aq]b\\[aq]:\n"
1118 " printf(\"option b\\[rs]n\");\n"
1119 " break;\n"
1120 "\\&\n"
1121 " case \\[aq]c\\[aq]:\n"
1122 " printf(\"option c with value \\[aq]%s\\[aq]\\[rs]n\", optarg);\n"
1123 " break;\n"
1124 "\\&\n"
1125 " case \\[aq]d\\[aq]:\n"
1126 " printf(\"option d with value \\[aq]%s\\[aq]\\[rs]n\", optarg);\n"
1127 " break;\n"
1128 "\\&\n"
1129 " case \\[aq]?\\[aq]:\n"
1130 " break;\n"
1131 "\\&\n"
1132 " default:\n"
1133 " printf(\"?? getopt returned character code 0%o ??\\[rs]n\", c);\n"
1134 " }\n"
1135 " }\n"
1136 "\\&\n"
1137 " if (optind E<lt> argc) {\n"
1138 " printf(\"non-option ARGV-elements: \");\n"
1139 " while (optind E<lt> argc)\n"
1140 " printf(\"%s \", argv[optind++]);\n"
1141 " printf(\"\\[rs]n\");\n"
1142 " }\n"
1143 "\\&\n"
1144 " exit(EXIT_SUCCESS);\n"
1145 "}\n"
1146 msgstr ""
1147
1148 #. type: Plain text
1149 #: debian-trixie fedora-44 fedora-rawhide
1150 msgid "B<getopt>(1), B<getsubopt>(3)"
1151 msgstr "B<getopt>(1), B<getsubopt>(3)"
1152
1153 #. type: TH
1154 #: fedora-44 fedora-rawhide
1155 #, no-wrap
1156 msgid "2024-12-19"
1157 msgstr "19 dezembro 2024"
1158
1159 #. type: TH
1160 #: fedora-44 fedora-rawhide
1161 #, no-wrap
1162 msgid "Linux man-pages 6.13"
1163 msgstr "Linux man-pages 6.13"
1164
1165 #. type: Plain text
1166 #: fedora-44 fedora-rawhide
1167 msgid ""
1168 "Very old versions of glibc were affected by a E<.UR https://"
1169 "\\:sourceware.org/\\:git/\\:?"
1170 "p=glibc.git;a=commitdiff;h=bf079e19f50d64aa5e05> "
1171 "B<_>I<PID>B<_GNU_nonoption_argv_flags_> environment variable E<.UE .>"
1172 msgstr ""
1173
1174 #. type: TH
1175 #: mageia-cauldron
1176 #, no-wrap
1177 msgid "Linux man-pages 6.17"
1178 msgstr "Linux man-pages 6.17"
1179
1180 #. type: TH
1181 #: opensuse-leap-16-1 opensuse-tumbleweed
1182 #, no-wrap
1183 msgid "Linux man-pages (unreleased)"
1184 msgstr "Linux man-pages (não lançado)"