Debian Codegraph @

po/es/man3/getopt.3.po

raw
1 # Spanish translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Gerardo Aburruzaga García <[email protected]>, 1998.
5 # Juan Piernas <[email protected]>, 1998-2000.
6 # Miguel Pérez Ibars <[email protected]>, 2005
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: manpages-l10n\n"
10 "POT-Creation-Date: 2026-06-05 06:25+0200\n"
11 "PO-Revision-Date: 2005-03-19 19:53+0200\n"
12 "Last-Translator: Miguel Pérez Ibars <[email protected]>\n"
13 "Language-Team: Spanish <[email protected]>\n"
14 "Language: es\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: Lokalize 20.04.1\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 Febrero 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 "Páginas de Manual de Linux 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 "NOMBRE"
49
50 #. type: Plain text
51 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
52 #: opensuse-tumbleweed
53 msgid "getopt, optarg, optind, opterr, optopt - Parse command-line options"
54 msgstr ""
55
56 #. type: SH
57 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
58 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
59 #, no-wrap
60 msgid "LIBRARY"
61 msgstr "BIBLIOTECA"
62
63 #. type: Plain text
64 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
65 #: opensuse-leap-16-1 opensuse-tumbleweed
66 msgid "Standard C library (I<libc>,\\ I<-lc>)"
67 msgstr "Biblioteca Estándar C (I<libc>,\\ I<-lc>)"
68
69 #. type: SH
70 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
71 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
72 #, no-wrap
73 msgid "SYNOPSIS"
74 msgstr "SINOPSIS"
75
76 #. type: Plain text
77 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
78 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
79 #, no-wrap
80 msgid "B<#include E<lt>unistd.hE<gt>>\n"
81 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
82
83 #. type: Plain text
84 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
85 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
86 #, fuzzy, no-wrap
87 #| msgid ""
88 #| "B<int getopt(int >I<argc>B<, char * const >I<argv[]>B<,>\n"
89 #| "B< const char *>I<optstring>B<);>\n"
90 msgid ""
91 "B<int getopt(int >I<argc>B<, char *>I<argv>B<[],>\n"
92 "B< const char *>I<optstring>B<);>\n"
93 msgstr ""
94 "B<int getopt(int >I<argc>B<, char * const >I<argv[]>B<,>\n"
95 "B< const char *>I<optstring>B<);>\n"
96
97 #. type: Plain text
98 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
99 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
100 #, no-wrap
101 msgid ""
102 "B<extern char *>I<optarg>B<;>\n"
103 "B<extern int >I<optind>B<, >I<opterr>B<, >I<optopt>B<;>\n"
104 msgstr ""
105 "B<extern char *>I<optarg>B<;>\n"
106 "B<extern int >I<optind>B<, >I<opterr>B<, >I<optopt>B<;>\n"
107
108 #. type: Plain text
109 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
110 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
111 msgid ""
112 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
113 msgstr ""
114 "Requisitos de Macros de Prueba de Características para glibc (véase "
115 "B<feature_test_macros>(7)):"
116
117 #. type: Plain text
118 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
119 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
120 msgid "B<getopt>():"
121 msgstr "B<getopt>():"
122
123 #. type: Plain text
124 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
125 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
126 #, no-wrap
127 msgid " _POSIX_C_SOURCE E<gt>= 2 || _XOPEN_SOURCE\n"
128 msgstr " _POSIX_C_SOURCE E<gt>= 2 || _XOPEN_SOURCE\n"
129
130 #. type: SH
131 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
132 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
133 #, no-wrap
134 msgid "DESCRIPTION"
135 msgstr "DESCRIPCIÓN"
136
137 #. type: Plain text
138 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
139 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
140 #, fuzzy
141 #| msgid ""
142 #| "The B<getopt>() function parses the command-line arguments. Its "
143 #| "arguments I<argc> and I<argv> are the argument count and array as passed "
144 #| "to the I<main>() function on program invocation. An element of I<argv> "
145 #| "that starts with \\(aq-\\(aq (and is not exactly \"-\" or \"--\") is an "
146 #| "option element. The characters of this element (aside from the initial \\"
147 #| "(aq-\\(aq) are option characters. If B<getopt>() is called repeatedly, "
148 #| "it returns successively each of the option characters from each of the "
149 #| "option elements."
150 msgid ""
151 "The B<getopt>() function parses the command-line arguments. Its arguments "
152 "I<argc> and I<argv> are the argument count and array as passed to the "
153 "I<main>() function on program invocation. An element of I<argv> that "
154 "starts with \\[aq]-\\[aq] (and is not exactly \"-\" or \"--\") is an option "
155 "element. The characters of this element (aside from the initial \\[aq]-\\"
156 "[aq]) are option characters. If B<getopt>() is called repeatedly, it "
157 "returns successively each of the option characters from each of the option "
158 "elements."
159 msgstr ""
160 "La función B<getopt>() analiza los argumentos de la línea de órdenes. Sus "
161 "argumentos I<argc> y I<argv> son el número y el vector de argumentos como "
162 "los pasados a la función I<main>() cuando se ejecuta el programa. Un "
163 "elemento de I<argv> que comience con \\(aq-\\(aq (y que no sea exactamente "
164 "\"-\" ni \"--\") es un elemento de opción. Los caracteres de este elemento "
165 "(aparte del \\(aq-\\(aq inicial) son caracteres de opción. Si B<getopt>() se "
166 "llama repetidamente, devuelve sucesivamente cada uno de los caracteres de "
167 "opción de cada uno de los elementos de opción."
168
169 #. type: Plain text
170 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
171 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
172 msgid ""
173 "The variable I<optind> is the index of the next element to be processed in "
174 "I<argv>. The system initializes this value to 1. The caller can reset it "
175 "to 1 to restart scanning of the same I<argv>, or when scanning a new "
176 "argument vector."
177 msgstr ""
178
179 #. type: Plain text
180 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
181 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
182 msgid ""
183 "If B<getopt>() finds another option character, it returns that character, "
184 "updating the external variable I<optind> and a static variable I<nextchar> "
185 "so that the next call to B<getopt>() can resume the scan with the following "
186 "option character or I<argv>-element."
187 msgstr ""
188 "Si B<getopt>() encuentra otro carácter de opción, lo devuelve, actualizando "
189 "la variable externa I<optind> y una variable estática I<nextchar> de forma "
190 "que la siguiente llamada a B<getopt>() pueda seguir la búsqueda en el "
191 "siguiente carácter de opción o elemento de I<argv>."
192
193 #. type: Plain text
194 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
195 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
196 msgid ""
197 "If there are no more option characters, B<getopt>() returns -1. Then "
198 "I<optind> is the index in I<argv> of the first I<argv>-element that is not "
199 "an option."
200 msgstr ""
201 "Si no hay más caracteres de opción, B<getopt>() devuelve -1. Entonces "
202 "I<optind> es el índice en I<argv> del primer elemento de I<argv> que no es "
203 "una opción."
204
205 #. type: Plain text
206 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
207 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
208 #, fuzzy
209 #| msgid ""
210 #| "I<optstring> is a string containing the legitimate option characters. If "
211 #| "such a character is followed by a colon, the option requires an argument, "
212 #| "so B<getopt> places a pointer to the following text in the same I<argv>-"
213 #| "element, or the text of the following I<argv>-element, in I<optarg>. Two "
214 #| "colons mean an option takes an optional arg; if there is text in the "
215 #| "current I<argv>-element, it is returned in I<optarg>, otherwise I<optarg> "
216 #| "is set to zero. This is a GNU extension. If I<optstring> contains B<W> "
217 #| "followed by a semicolon, then B<-W foo> is treated as the long option B<--"
218 #| "foo>. (The B<-W> option is reserved by POSIX.2 for implementation "
219 #| "extensions.) This behaviour is a GNU extension, not available with "
220 #| "libraries before GNU libc 2."
221 msgid ""
222 "I<optstring> is a string containing the legitimate option characters. A "
223 "legitimate option character is any visible one byte B<ascii>(7) character "
224 "(for which B<isgraph>(3) would return nonzero) that is not \\[aq]-\\[aq], \\"
225 "[aq]:\\[aq], or \\[aq];\\[aq]. If such a character is followed by a colon, "
226 "the option requires an argument, so B<getopt>() places a pointer to the "
227 "following text in the same I<argv>-element, or the text of the following "
228 "I<argv>-element, in I<optarg>. Two colons mean an option takes an optional "
229 "arg; if there is text in the current I<argv>-element (i.e., in the same word "
230 "as the option name itself, for example, \"-oarg\"), then it is returned in "
231 "I<optarg>, otherwise I<optarg> is set to zero. This is a GNU extension. If "
232 "I<optstring> contains B<W> followed by a semicolon, then B<-W foo> is "
233 "treated as the long option B<--foo>. (The B<-W> option is reserved by "
234 "POSIX.2 for implementation extensions.) This behavior is a GNU extension, "
235 "not available with libraries before glibc 2."
236 msgstr ""
237 "I<optstring> es una cadena que contiene los caracteres de opción legítimos. "
238 "Si un carácter de éstos es seguido por el carácter de dos puntos, la opción "
239 "necesita un argumento, de forma que B<getopt> coloca un puntero al texto "
240 "siguiente en el mismo elemento de I<argv>, o el texto del siguiente elemento "
241 "de I<argv>, en I<optarg>. Dos caracteres de dos puntos significan que una "
242 "opción toma un arg. opcional; si hay texto en el elemento de I<argv> actual, "
243 "se devuelve en I<optarg>; si no, I<optarg> se pone a cero. Lo siguiente es "
244 "una extensión de GNU. Si I<optstring> contiene B<W> seguido por un punto y "
245 "coma, entonces B<-W foo> se trata como la opción larga B<--foo>. (La opción "
246 "B<-W> está reservada en POSIX.2 para extensiones de implementación). Este "
247 "comportamiento es una extensión de GNU, no disponible en bibliotecas "
248 "anteriores a la versión 2 de GNU libc."
249
250 #. type: Plain text
251 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
252 #: opensuse-tumbleweed
253 #, fuzzy
254 #| msgid ""
255 #| "By default, B<getopt>() permutes the contents of I<argv> as it scans, so "
256 #| "that eventually all the nonoptions are at the end. Two other modes are "
257 #| "also implemented. If the first character of I<optstring> is \\(aq+\\(aq "
258 #| "or the environment variable B<POSIXLY_CORRECT> is set, then option "
259 #| "processing stops as soon as a nonoption argument is encountered. If the "
260 #| "first character of I<optstring> is \\(aq-\\(aq, then each nonoption "
261 #| "I<argv>-element is handled as if it were the argument of an option with "
262 #| "character code 1. (This is used by programs that were written to expect "
263 #| "options and other I<argv>-elements in any order and that care about the "
264 #| "ordering of the two.) The special argument \"--\" forces an end of "
265 #| "option-scanning regardless of the scanning mode."
266 msgid ""
267 "By default, B<getopt>() permutes the contents of I<argv> as it scans, so "
268 "that eventually all the nonoptions are at the end. Two other scanning modes "
269 "are also implemented. If the first character of I<optstring> is \\[aq]+\\"
270 "[aq] or the environment variable B<\\%POSIXLY_CORRECT> is set, then option "
271 "processing stops as soon as a nonoption argument is encountered. If \\[aq]+"
272 "\\[aq] is not the first character of I<optstring>, it is treated as a normal "
273 "option. If B<\\%POSIXLY_CORRECT> behavior is required in this case "
274 "I<optstring> will contain two \\[aq]+\\[aq] symbols. If the first character "
275 "of I<optstring> is \\[aq]-\\[aq], then each nonoption I<argv>-element is "
276 "handled as if it were the argument of an option with character code 1. "
277 "(This is used by programs that were written to expect options and other "
278 "I<argv>-elements in any order and that care about the ordering of the two.) "
279 "The special argument \"--\" forces an end of option-scanning regardless of "
280 "the scanning mode."
281 msgstr ""
282 "Por omisión, B<getopt>() permuta los contenidos de I<argv> cuando lo "
283 "escudriña, de modo que todo lo que no sea una opción vaya al final. Están "
284 "implementados otros dos modos de operación. Si el primer carácter de "
285 "I<optstring> es \\(aq+\\(aq o está definida la variable de entorno "
286 "B<POSIXLY_CORRECT>, entonces el procesamiento de la opción se para tan "
287 "pronto se encuentra un argumento que no es una opción. Si el primer "
288 "carácter de I<optstring> es \\(aq-\\(aq, entonces cada elemento de I<argv> "
289 "que no sea una opción se maneja como si fuera el argumento de una opción con "
290 "código de carácter 1. (Esto se usa en programas que fueron escritos para "
291 "esperar opciones y otros elementos de I<argv> en cualquier orden y donde "
292 "importa el ordenamiento de ambos). El argumento especial \"--\" fuerza que "
293 "se acabe el rastreo de las opciones sin tenerse en cuenta el modo."
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 DEVUELTO"
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 "ENTORNO"
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 "Si está definida, entonces el procesamiento de las opciones se para tan "
387 "pronto como se encuentre un argumento que no sea una opción."
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 obtener una explicación de los términos usados en esta sección, véase "
403 "B<attributes>(7)."
404
405 #. type: tbl table
406 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
407 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
408 #, no-wrap
409 msgid "Interface"
410 msgstr "Interfaz"
411
412 #. type: tbl table
413 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
414 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
415 #, no-wrap
416 msgid "Attribute"
417 msgstr "Atributo"
418
419 #. type: tbl table
420 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
421 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
422 #, no-wrap
423 msgid "Value"
424 msgstr "Valor"
425
426 #. type: tbl table
427 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
428 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
429 #, no-wrap
430 msgid ".na\n"
431 msgstr ".na\n"
432
433 #. type: tbl table
434 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
435 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
436 #, no-wrap
437 msgid ".nh\n"
438 msgstr ".nh\n"
439
440 #. type: TP
441 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
442 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
443 #, fuzzy, no-wrap
444 #| msgid "B<getopt>():"
445 msgid "B<getopt>()"
446 msgstr "B<getopt>():"
447
448 #. type: tbl table
449 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
450 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
451 #, no-wrap
452 msgid "Thread safety"
453 msgstr "Seguridad del hilo"
454
455 #. type: tbl table
456 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
457 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
458 #, no-wrap
459 msgid "MT-Unsafe race:getopt env"
460 msgstr ""
461
462 #. type: SH
463 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
464 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
465 #, no-wrap
466 msgid "VERSIONS"
467 msgstr "VERSIONES"
468
469 #. type: Plain text
470 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
471 #: opensuse-tumbleweed
472 msgid ""
473 "POSIX specifies that the I<argv> array argument should be I<const>, but "
474 "these functions permute its elements unless the environment variable B<\\"
475 "%POSIXLY_CORRECT> is set. I<const> is used in the actual prototype to be "
476 "compatible with other systems; however, this page doesn't show the "
477 "qualifier, to avoid confusing readers."
478 msgstr ""
479
480 #. type: SH
481 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
482 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
483 #, no-wrap
484 msgid "STANDARDS"
485 msgstr "ESTÁNDARES"
486
487 #. type: Plain text
488 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
489 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
490 msgid "POSIX.1-2008."
491 msgstr "POSIX.1-2008."
492
493 #. type: Plain text
494 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
495 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
496 msgid ""
497 "The use of \\[aq]+\\[aq] and \\[aq]-\\[aq] in I<optstring> is a GNU "
498 "extension."
499 msgstr ""
500
501 #. type: SH
502 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
503 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
504 #, no-wrap
505 msgid "HISTORY"
506 msgstr "HISTORIAL"
507
508 #. type: Plain text
509 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
510 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
511 #, fuzzy
512 #| msgid "POSIX.1-2001, POSIX.1-2008."
513 msgid "POSIX.1-2001, and POSIX.2."
514 msgstr "POSIX.1-2001, POSIX.1-2008."
515
516 #. type: Plain text
517 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
518 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
519 msgid ""
520 "On some older implementations, B<getopt>() was declared in "
521 "I<E<lt>stdio.hE<gt>>. SUSv1 permitted the declaration to appear in either "
522 "I<E<lt>unistd.hE<gt>> or I<E<lt>stdio.hE<gt>>. POSIX.1-1996 marked the use "
523 "of I<E<lt>stdio.hE<gt>> for this purpose as LEGACY. POSIX.1-2001 does not "
524 "require the declaration to appear in I<E<lt>stdio.hE<gt>>."
525 msgstr ""
526
527 #. type: Plain text
528 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
529 #: opensuse-tumbleweed
530 msgid ""
531 "Very old versions of glibc were affected by a E<.UR https:\\://"
532 "\\:sourceware.org/\\:git/\\:?"
533 "p=glibc.git;a=commitdiff;h=bf079e19f50d64aa5e05> B<\\"
534 "%_>I<PID>B<_GNU_nonoption_argv_flags_> environment variable E<.UE .>"
535 msgstr ""
536
537 #. type: SH
538 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
539 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
540 #, no-wrap
541 msgid "NOTES"
542 msgstr "NOTAS"
543
544 #. type: Plain text
545 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
546 #: opensuse-tumbleweed
547 msgid ""
548 "A program that scans multiple argument vectors, or rescans the same vector "
549 "more than once, and wants to make use of GNU extensions such as \\[aq]+\\"
550 "[aq] and \\[aq]-\\[aq] at the start of I<optstring>, or changes the value of "
551 "B<\\%POSIXLY_CORRECT> between scans, must reinitialize B<getopt>() by "
552 "resetting I<optind> to 0, rather than the traditional value of 1. "
553 "(Resetting to 0 forces the invocation of an internal initialization routine "
554 "that rechecks B<\\%POSIXLY_CORRECT> and checks for GNU extensions in "
555 "I<optstring>.)"
556 msgstr ""
557
558 #. type: Plain text
559 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
560 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
561 msgid ""
562 "Command-line arguments are parsed in strict order meaning that an option "
563 "requiring an argument will consume the next argument, regardless of whether "
564 "that argument is the correctly specified option argument or simply the next "
565 "option (in the scenario the user mis-specifies the command line). For "
566 "example, if I<optstring> is specified as \"1n:\" and the user specifies the "
567 "command line arguments incorrectly as I<prog\\ -n\\ -1>, the I<-n> option "
568 "will be given the B<optarg> value \"-1\", and the I<-1> option will be "
569 "considered to have not been specified."
570 msgstr ""
571
572 #. type: SH
573 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
574 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
575 #, no-wrap
576 msgid "EXAMPLES"
577 msgstr "EJEMPLOS"
578
579 #. type: SS
580 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
581 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
582 #, no-wrap
583 msgid "getopt()"
584 msgstr "getopt()"
585
586 #. type: Plain text
587 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
588 #: opensuse-tumbleweed
589 msgid ""
590 "The following trivial example program uses B<getopt>() to handle two "
591 "program options: I<-n>, with no associated value; and I<-t\\ val>, which "
592 "expects an associated value."
593 msgstr ""
594
595 #. type: Plain text
596 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
597 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
598 #, fuzzy, no-wrap
599 #| msgid ""
600 #| " nsecs = 0;\n"
601 #| " tfnd = 0;\n"
602 #| " flags = 0;\n"
603 #| " while ((opt = getopt(argc, argv, \"nt:\")) != -1) {\n"
604 #| " switch (opt) {\n"
605 #| " case \\(aqn\\(aq:\n"
606 #| " flags = 1;\n"
607 #| " break;\n"
608 #| " case \\(aqt\\(aq:\n"
609 #| " nsecs = atoi(optarg);\n"
610 #| " tfnd = 1;\n"
611 #| " break;\n"
612 #| " default: /* \\(aq?\\(aq */\n"
613 #| " fprintf(stderr, \"Usage: %s [-t nsecs] [-n] name\\en\",\n"
614 #| " argv[0]);\n"
615 #| " exit(EXIT_FAILURE);\n"
616 #| " }\n"
617 #| " }\n"
618 msgid ""
619 "#include E<lt>stdio.hE<gt>\n"
620 "#include E<lt>stdlib.hE<gt>\n"
621 "#include E<lt>unistd.hE<gt>\n"
622 "\\&\n"
623 "int\n"
624 "main(int argc, char *argv[])\n"
625 "{\n"
626 " int flags, opt;\n"
627 " int nsecs, tfnd;\n"
628 "\\&\n"
629 " nsecs = 0;\n"
630 " tfnd = 0;\n"
631 " flags = 0;\n"
632 " while ((opt = getopt(argc, argv, \"nt:\")) != -1) {\n"
633 " switch (opt) {\n"
634 " case \\[aq]n\\[aq]:\n"
635 " flags = 1;\n"
636 " break;\n"
637 " case \\[aq]t\\[aq]:\n"
638 " nsecs = atoi(optarg);\n"
639 " tfnd = 1;\n"
640 " break;\n"
641 " default: /* \\[aq]?\\[aq] */\n"
642 " fprintf(stderr, \"Usage: %s [-t nsecs] [-n] name\\[rs]n\",\n"
643 " argv[0]);\n"
644 " exit(EXIT_FAILURE);\n"
645 " }\n"
646 " }\n"
647 "\\&\n"
648 " printf(\"flags=%d; tfnd=%d; nsecs=%d; optind=%d\\[rs]n\",\n"
649 " flags, tfnd, nsecs, optind);\n"
650 "\\&\n"
651 " if (optind E<gt>= argc) {\n"
652 " fprintf(stderr, \"Expected argument after options\\[rs]n\");\n"
653 " exit(EXIT_FAILURE);\n"
654 " }\n"
655 "\\&\n"
656 " printf(\"name argument = %s\\[rs]n\", argv[optind]);\n"
657 "\\&\n"
658 " /* Other code omitted */\n"
659 "\\&\n"
660 " exit(EXIT_SUCCESS);\n"
661 "}\n"
662 msgstr ""
663 " nsecs = 0;\n"
664 " tfnd = 0;\n"
665 " flags = 0;\n"
666 " while ((opt = getopt(argc, argv, \"nt:\")) != -1) {\n"
667 " switch (opt) {\n"
668 " case \\(aqn\\(aq:\n"
669 " flags = 1;\n"
670 " break;\n"
671 " case \\(aqt\\(aq:\n"
672 " nsecs = atoi(optarg);\n"
673 " tfnd = 1;\n"
674 " break;\n"
675 " default: /* \\(aq?\\(aq */\n"
676 " fprintf(stderr, \"Usage: %s [-t nsecs] [-n] name\\en\",\n"
677 " argv[0]);\n"
678 " exit(EXIT_FAILURE);\n"
679 " }\n"
680 " }\n"
681
682 #. SRC END
683 #. type: SH
684 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
685 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
686 #, no-wrap
687 msgid "SEE ALSO"
688 msgstr "VÉASE TAMBIÉN"
689
690 #. type: Plain text
691 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
692 #: opensuse-tumbleweed
693 #, fuzzy
694 #| msgid ""
695 #| "B<getopt>(),\n"
696 #| "B<getopt_long>(),\n"
697 #| "B<getopt_long_only>()"
698 msgid ""
699 "B<getopt>(1), B<getopt_long>(3), B<getopt_long_only>(3), B<getsubopt>(3)"
700 msgstr ""
701 "B<getopt>(),\n"
702 "B<getopt_long>(),\n"
703 "B<getopt_long_only>()"
704
705 #. type: TH
706 #: debian-trixie
707 #, no-wrap
708 msgid "2024-06-15"
709 msgstr "15 Junio 2024"
710
711 #. type: TH
712 #: debian-trixie
713 #, no-wrap
714 msgid "Linux man-pages 6.9.1"
715 msgstr "Páginas de Manual de Linux 6.9.1"
716
717 #. type: Plain text
718 #: debian-trixie fedora-44 fedora-rawhide
719 msgid ""
720 "getopt, getopt_long, getopt_long_only, optarg, optind, opterr, optopt - "
721 "Parse command-line options"
722 msgstr ""
723
724 #. type: Plain text
725 #: debian-trixie
726 msgid "Standard C library (I<libc>, I<-lc>)"
727 msgstr "Biblioteca Estándar C (I<libc>, I<-lc>)"
728
729 #. type: Plain text
730 #: debian-trixie fedora-44 fedora-rawhide
731 #, no-wrap
732 msgid "B<#include E<lt>getopt.hE<gt>>\n"
733 msgstr "B<#include E<lt>getopt.hE<gt>>\n"
734
735 #. type: Plain text
736 #: debian-trixie fedora-44 fedora-rawhide
737 #, fuzzy, no-wrap
738 #| msgid ""
739 #| "B<int getopt_long_only(int >I<argc>B<, char * const >I<argv[]>B<,>\n"
740 #| "B< const char *>I<optstring>B<,>\n"
741 #| "B< const struct option *>I<longopts>B<, int *>I<longindex>B<);>\n"
742 msgid ""
743 "B<int getopt_long(int >I<argc>B<, char *>I<argv>B<[],>\n"
744 "B< const char *>I<optstring>B<,>\n"
745 "B< const struct option *>I<longopts>B<, int *>I<longindex>B<);>\n"
746 "B<int getopt_long_only(int >I<argc>B<, char *>I<argv>B<[],>\n"
747 "B< const char *>I<optstring>B<,>\n"
748 "B< const struct option *>I<longopts>B<, int *>I<longindex>B<);>\n"
749 msgstr ""
750 "B<int getopt_long_only(int >I<argc>B<, char * const >I<argv[]>B<,>\n"
751 "B< const char *>I<optstring>B<,>\n"
752 "B< const struct option *>I<longopts>B<, int *>I<longindex>B<);>\n"
753
754 #. type: Plain text
755 #: debian-trixie fedora-44 fedora-rawhide
756 #, fuzzy
757 #| msgid "B<getopt_long>() and B<getopt_long_only>():"
758 msgid "B<getopt_long>(), B<getopt_long_only>():"
759 msgstr "B<getopt_long>() y B<getopt_long_only>():"
760
761 #. type: Plain text
762 #: debian-trixie fedora-44 fedora-rawhide
763 #, no-wrap
764 msgid " _GNU_SOURCE\n"
765 msgstr " _GNU_SOURCE\n"
766
767 #. type: Plain text
768 #: debian-trixie fedora-44 fedora-rawhide
769 #, fuzzy
770 #| msgid ""
771 #| "By default, B<getopt>() permutes the contents of I<argv> as it scans, so "
772 #| "that eventually all the nonoptions are at the end. Two other modes are "
773 #| "also implemented. If the first character of I<optstring> is \\(aq+\\(aq "
774 #| "or the environment variable B<POSIXLY_CORRECT> is set, then option "
775 #| "processing stops as soon as a nonoption argument is encountered. If the "
776 #| "first character of I<optstring> is \\(aq-\\(aq, then each nonoption "
777 #| "I<argv>-element is handled as if it were the argument of an option with "
778 #| "character code 1. (This is used by programs that were written to expect "
779 #| "options and other I<argv>-elements in any order and that care about the "
780 #| "ordering of the two.) The special argument \"--\" forces an end of "
781 #| "option-scanning regardless of the scanning mode."
782 msgid ""
783 "By default, B<getopt>() permutes the contents of I<argv> as it scans, so "
784 "that eventually all the nonoptions are at the end. Two other scanning modes "
785 "are also implemented. If the first character of I<optstring> is \\[aq]+\\"
786 "[aq] or the environment variable B<POSIXLY_CORRECT> is set, then option "
787 "processing stops as soon as a nonoption argument is encountered. If \\[aq]+"
788 "\\[aq] is not the first character of I<optstring>, it is treated as a normal "
789 "option. If B<POSIXLY_CORRECT> behaviour is required in this case "
790 "I<optstring> will contain two \\[aq]+\\[aq] symbols. If the first character "
791 "of I<optstring> is \\[aq]-\\[aq], then each nonoption I<argv>-element is "
792 "handled as if it were the argument of an option with character code 1. "
793 "(This is used by programs that were written to expect options and other "
794 "I<argv>-elements in any order and that care about the ordering of the two.) "
795 "The special argument \"--\" forces an end of option-scanning regardless of "
796 "the scanning mode."
797 msgstr ""
798 "Por omisión, B<getopt>() permuta los contenidos de I<argv> cuando lo "
799 "escudriña, de modo que todo lo que no sea una opción vaya al final. Están "
800 "implementados otros dos modos de operación. Si el primer carácter de "
801 "I<optstring> es \\(aq+\\(aq o está definida la variable de entorno "
802 "B<POSIXLY_CORRECT>, entonces el procesamiento de la opción se para tan "
803 "pronto se encuentra un argumento que no es una opción. Si el primer "
804 "carácter de I<optstring> es \\(aq-\\(aq, entonces cada elemento de I<argv> "
805 "que no sea una opción se maneja como si fuera el argumento de una opción con "
806 "código de carácter 1. (Esto se usa en programas que fueron escritos para "
807 "esperar opciones y otros elementos de I<argv> en cualquier orden y donde "
808 "importa el ordenamiento de ambos). El argumento especial \"--\" fuerza que "
809 "se acabe el rastreo de las opciones sin tenerse en cuenta el modo."
810
811 #. type: SS
812 #: debian-trixie fedora-44 fedora-rawhide
813 #, no-wrap
814 msgid "getopt_long() and getopt_long_only()"
815 msgstr "getopt_long() y getopt_long_only()"
816
817 #. type: Plain text
818 #: debian-trixie fedora-44 fedora-rawhide
819 #, fuzzy
820 #| msgid ""
821 #| "The B<getopt_long()> function works like B<getopt()> except that it also "
822 #| "accepts long options, started out by two dashes. Long option names may "
823 #| "be abbreviated if the abbreviation is unique or is an exact match for "
824 #| "some defined option. A long option may take a parameter, of the form B<--"
825 #| "arg=param> or B<--arg param>."
826 msgid ""
827 "The B<getopt_long>() function works like B<getopt>() except that it also "
828 "accepts long options, started with two dashes. (If the program accepts only "
829 "long options, then I<optstring> should be specified as an empty string "
830 "(\"\"), not NULL.) Long option names may be abbreviated if the abbreviation "
831 "is unique or is an exact match for some defined option. A long option may "
832 "take a parameter, of the form B<--arg=param> or B<--arg param>."
833 msgstr ""
834 "La función B<getopt_long()> trabaja como B<getopt()> salvo en que también "
835 "acepta opciones largas, que empiezan por dos guiones. Los nombres de opción "
836 "largos pueden abreviarse si la abreviatura es única o si es una concordancia "
837 "exacta para alguna opción definida. Una opción larga puede tomar un "
838 "parámetro, de la forma B<--arg=param> o B<--arg param>."
839
840 #. type: Plain text
841 #: debian-trixie fedora-44 fedora-rawhide
842 msgid ""
843 "I<longopts> is a pointer to the first element of an array of I<struct "
844 "option> declared in I<E<lt>getopt.hE<gt>> as"
845 msgstr ""
846 "I<longopts> es un puntero al primer elemento de un vector de I<struct "
847 "option> declarado en I<E<lt>getopt.hE<gt>> como"
848
849 #. type: Plain text
850 #: debian-trixie fedora-44 fedora-rawhide
851 #, no-wrap
852 msgid ""
853 "struct option {\n"
854 " const char *name;\n"
855 " int has_arg;\n"
856 " int *flag;\n"
857 " int val;\n"
858 "};\n"
859 msgstr ""
860 "struct option {\n"
861 " const char *name;\n"
862 " int has_arg;\n"
863 " int *flag;\n"
864 " int val;\n"
865 "};\n"
866
867 #. type: Plain text
868 #: debian-trixie fedora-44 fedora-rawhide
869 msgid "The meanings of the different fields are:"
870 msgstr "Los significados de los diferentes campos son:"
871
872 #. type: TP
873 #: debian-trixie fedora-44 fedora-rawhide
874 #, no-wrap
875 msgid "I<name>"
876 msgstr "I<nombre>"
877
878 #. type: Plain text
879 #: debian-trixie fedora-44 fedora-rawhide
880 msgid "is the name of the long option."
881 msgstr "es el nombre de la opción larga."
882
883 #. type: TP
884 #: debian-trixie fedora-44 fedora-rawhide
885 #, no-wrap
886 msgid "I<has_arg>"
887 msgstr "I<has_arg>"
888
889 #. type: Plain text
890 #: debian-trixie fedora-44 fedora-rawhide
891 msgid ""
892 "is: B<no_argument> (or 0) if the option does not take an argument; "
893 "B<required_argument> (or 1) if the option requires an argument; or "
894 "B<optional_argument> (or 2) if the option takes an optional argument."
895 msgstr ""
896 "es: B<no_argument> (ó 0) si la opción no toma un argumento; "
897 "B<required_argument> (ó 1) si la opción requiere un argumento; u "
898 "B<optional_argument> (ó 2) si la opción toma un argumento opcional."
899
900 #. type: TP
901 #: debian-trixie fedora-44 fedora-rawhide
902 #, no-wrap
903 msgid "I<flag>"
904 msgstr "I<flag>"
905
906 #. type: Plain text
907 #: debian-trixie fedora-44 fedora-rawhide
908 msgid ""
909 "specifies how results are returned for a long option. If I<flag> is NULL, "
910 "then B<getopt_long>() returns I<val>. (For example, the calling program "
911 "may set I<val> to the equivalent short option character.) Otherwise, "
912 "B<getopt_long>() returns 0, and I<flag> points to a variable which is set "
913 "to I<val> if the option is found, but left unchanged if the option is not "
914 "found."
915 msgstr ""
916 "especifica cómo se devuelven los resultados para una opción larga. Si "
917 "I<flag> es NULL, entonces B<getopt_long>() devuelve I<val>. (Por ejemplo, el "
918 "programa puede poner I<val> como el carácter de opción corta equivalente.) "
919 "De otro modo, B<getopt_long>() devuelve 0, y I<flag> apunta a una variable "
920 "que se pone a I<val> si la opción se encuentra, pero que se deja intacta si "
921 "la opción no se encuentra."
922
923 #. type: TP
924 #: debian-trixie fedora-44 fedora-rawhide
925 #, no-wrap
926 msgid "I<val>"
927 msgstr "I<val>"
928
929 #. type: Plain text
930 #: debian-trixie fedora-44 fedora-rawhide
931 msgid ""
932 "is the value to return, or to load into the variable pointed to by I<flag>."
933 msgstr ""
934 "es el valor a devolver, o a cargar en la variable apuntada por I<flag>."
935
936 #. type: Plain text
937 #: debian-trixie fedora-44 fedora-rawhide
938 msgid "The last element of the array has to be filled with zeros."
939 msgstr "El último elemento del vector tiene que ser llenado con ceros."
940
941 #. type: Plain text
942 #: debian-trixie fedora-44 fedora-rawhide
943 msgid ""
944 "If I<longindex> is not NULL, it points to a variable which is set to the "
945 "index of the long option relative to I<longopts>."
946 msgstr ""
947 "Si I<longindex> no es NULL, apunta a una variable que toma el valor del "
948 "índice de la opción larga relativa a I<longopts>."
949
950 #. type: Plain text
951 #: debian-trixie fedora-44 fedora-rawhide
952 #, fuzzy
953 #| msgid ""
954 #| "B<getopt_long_only>() is like B<getopt_long>(), but \\(aq-\\(aq as well "
955 #| "as \"--\" can indicate a long option. If an option that starts with \\"
956 #| "(aq-\\(aq (not \"--\") doesn't match a long option, but does match a "
957 #| "short option, it is parsed as a short option instead."
958 msgid ""
959 "B<getopt_long_only>() is like B<getopt_long>(), but \\[aq]-\\[aq] as well "
960 "as \"--\" can indicate a long option. If an option that starts with \\[aq]-"
961 "\\[aq] (not \"--\") doesn't match a long option, but does match a short "
962 "option, it is parsed as a short option instead."
963 msgstr ""
964 "B<getopt_long_only>() es como B<getopt_long()>, pero tanto \\(aq-\\(aq como "
965 "\"--\" pueden indicar una opción larga. Si una opción que empiece por \\(aq-"
966 "\\(aq (no \"--\") no concordara con una opción larga, pero sí con una corta, "
967 "se consideraría como tal."
968
969 #. type: Plain text
970 #: debian-trixie fedora-44 fedora-rawhide
971 #, fuzzy
972 #| msgid ""
973 #| "B<getopt_long>() and B<getopt_long_only>() also return the option "
974 #| "character when a short option is recognized. For a long option, they "
975 #| "return I<val> if I<flag> is NULL, and 0 otherwise. Error and -1 returns "
976 #| "are the same as for B<getopt>(), plus \\(aq?\\(aq for an ambiguous match "
977 #| "or an extraneous parameter."
978 msgid ""
979 "B<getopt_long>() and B<getopt_long_only>() also return the option "
980 "character when a short option is recognized. For a long option, they return "
981 "I<val> if I<flag> is NULL, and 0 otherwise. Error and -1 returns are the "
982 "same as for B<getopt>(), plus \\[aq]?\\[aq] for an ambiguous match or an "
983 "extraneous parameter."
984 msgstr ""
985 "B<getopt_long>() y B<getopt_long_only>() también devuelven el carácter de la "
986 "opción cuendo se reconoce una corta. Para una opción larga, devuelven I<val> "
987 "si I<flag> es NULL, y 0 en otra circunstancia. Las devoluciones de error y "
988 "-1 son las mismas que para B<getopt>(), más \\(aq?\\(aq indicando una "
989 "concordancia ambigua o un parámetro extraño."
990
991 #. type: TP
992 #: debian-trixie fedora-44 fedora-rawhide
993 #, no-wrap
994 msgid "B<POSIXLY_CORRECT>"
995 msgstr "B<POSIXLY_CORRECT>"
996
997 #. type: TP
998 #: debian-trixie
999 #, no-wrap
1000 msgid "B<_E<lt>PIDE<gt>_GNU_nonoption_argv_flags_>"
1001 msgstr "B<_E<lt>PIDE<gt>_GNU_nonoption_argv_flags_>"
1002
1003 #. type: Plain text
1004 #: debian-trixie
1005 #, fuzzy
1006 #| msgid ""
1007 #| "This variable was used by B<bash>(1) 2.0 to communicate to glibc which "
1008 #| "arguments are the results of wildcard expansion and so should not be "
1009 #| "considered as options. This behavior was removed in B<bash>(1) version "
1010 #| "2.01, but the support remains in glibc."
1011 msgid ""
1012 "This variable was used by B<bash>(1) 2.0 to communicate to glibc which "
1013 "arguments are the results of wildcard expansion and so should not be "
1014 "considered as options. This behavior was removed in B<bash>(1) 2.01, but "
1015 "the support remains in glibc."
1016 msgstr ""
1017 "Esta variable era utilizada por B<bash>(1) 2.0 para comunicar a glibc qué "
1018 "argumentos eran el resultado de la expansión de comodines y, por tanto, no "
1019 "debían considerarse como opciones. Este comportamiento se eliminó en la "
1020 "versión 2.01 de B<bash>(1) pero el soporte permanece en glibc."
1021
1022 #. type: tbl table
1023 #: debian-trixie fedora-44 fedora-rawhide
1024 #, no-wrap
1025 msgid ""
1026 "B<getopt>(),\n"
1027 "B<getopt_long>(),\n"
1028 "B<getopt_long_only>()"
1029 msgstr ""
1030 "B<getopt>(),\n"
1031 "B<getopt_long>(),\n"
1032 "B<getopt_long_only>()"
1033
1034 #. type: Plain text
1035 #: debian-trixie fedora-44 fedora-rawhide
1036 msgid ""
1037 "POSIX specifies that the I<argv> array argument should be I<const>, but "
1038 "these functions permute its elements unless the environment variable "
1039 "B<POSIXLY_CORRECT> is set. I<const> is used in the actual prototype to be "
1040 "compatible with other systems; however, this page doesn't show the "
1041 "qualifier, to avoid confusing readers."
1042 msgstr ""
1043
1044 #. type: TP
1045 #: debian-trixie fedora-44 fedora-rawhide
1046 #, fuzzy, no-wrap
1047 #| msgid "getopt_long()"
1048 msgid "B<getopt_long>()"
1049 msgstr "getopt_long()"
1050
1051 #. type: TQ
1052 #: debian-trixie fedora-44 fedora-rawhide
1053 #, fuzzy, no-wrap
1054 #| msgid "getopt_long()"
1055 msgid "B<getopt_long_only>()"
1056 msgstr "getopt_long()"
1057
1058 #. type: Plain text
1059 #: debian-trixie fedora-44 fedora-rawhide
1060 msgid "GNU."
1061 msgstr "GNU."
1062
1063 #. type: Plain text
1064 #: debian-trixie fedora-44 fedora-rawhide
1065 msgid ""
1066 "A program that scans multiple argument vectors, or rescans the same vector "
1067 "more than once, and wants to make use of GNU extensions such as \\[aq]+\\"
1068 "[aq] and \\[aq]-\\[aq] at the start of I<optstring>, or changes the value of "
1069 "B<POSIXLY_CORRECT> between scans, must reinitialize B<getopt>() by "
1070 "resetting I<optind> to 0, rather than the traditional value of 1. "
1071 "(Resetting to 0 forces the invocation of an internal initialization routine "
1072 "that rechecks B<POSIXLY_CORRECT> and checks for GNU extensions in "
1073 "I<optstring>.)"
1074 msgstr ""
1075
1076 #. type: Plain text
1077 #: debian-trixie fedora-44 fedora-rawhide
1078 msgid ""
1079 "The following trivial example program uses B<getopt>() to handle two "
1080 "program options: I<-n>, with no associated value; and I<-t val>, which "
1081 "expects an associated value."
1082 msgstr ""
1083
1084 #. SRC END
1085 #. type: SS
1086 #: debian-trixie fedora-44 fedora-rawhide
1087 #, no-wrap
1088 msgid "getopt_long()"
1089 msgstr "getopt_long()"
1090
1091 #. type: Plain text
1092 #: debian-trixie fedora-44 fedora-rawhide
1093 msgid ""
1094 "The following example program illustrates the use of B<getopt_long>() with "
1095 "most of its features."
1096 msgstr ""
1097 "El siguiente programa de ejemplo ilustra el empleo de B<getopt_long>() con "
1098 "la mayoría de sus características."
1099
1100 #. type: Plain text
1101 #: debian-trixie fedora-44 fedora-rawhide
1102 #, no-wrap
1103 msgid ""
1104 "#include E<lt>getopt.hE<gt>\n"
1105 "#include E<lt>stdio.hE<gt> /* for printf */\n"
1106 "#include E<lt>stdlib.hE<gt> /* for exit */\n"
1107 "\\&\n"
1108 "int\n"
1109 "main(int argc, char *argv[])\n"
1110 "{\n"
1111 " int c;\n"
1112 " int digit_optind = 0;\n"
1113 "\\&\n"
1114 " while (1) {\n"
1115 " int this_option_optind = optind ? optind : 1;\n"
1116 " int option_index = 0;\n"
1117 " static struct option long_options[] = {\n"
1118 " {\"add\", required_argument, 0, 0 },\n"
1119 " {\"append\", no_argument, 0, 0 },\n"
1120 " {\"delete\", required_argument, 0, 0 },\n"
1121 " {\"verbose\", no_argument, 0, 0 },\n"
1122 " {\"create\", required_argument, 0, \\[aq]c\\[aq]},\n"
1123 " {\"file\", required_argument, 0, 0 },\n"
1124 " {0, 0, 0, 0 }\n"
1125 " };\n"
1126 "\\&\n"
1127 " c = getopt_long(argc, argv, \"abc:d:012\",\n"
1128 " long_options, &option_index);\n"
1129 " if (c == -1)\n"
1130 " break;\n"
1131 "\\&\n"
1132 " switch (c) {\n"
1133 " case 0:\n"
1134 " printf(\"option %s\", long_options[option_index].name);\n"
1135 " if (optarg)\n"
1136 " printf(\" with arg %s\", optarg);\n"
1137 " printf(\"\\[rs]n\");\n"
1138 " break;\n"
1139 "\\&\n"
1140 " case \\[aq]0\\[aq]:\n"
1141 " case \\[aq]1\\[aq]:\n"
1142 " case \\[aq]2\\[aq]:\n"
1143 " if (digit_optind != 0 && digit_optind != this_option_optind)\n"
1144 " printf(\"digits occur in two different argv-elements.\\[rs]n\");\n"
1145 " digit_optind = this_option_optind;\n"
1146 " printf(\"option %c\\[rs]n\", c);\n"
1147 " break;\n"
1148 "\\&\n"
1149 " case \\[aq]a\\[aq]:\n"
1150 " printf(\"option a\\[rs]n\");\n"
1151 " break;\n"
1152 "\\&\n"
1153 " case \\[aq]b\\[aq]:\n"
1154 " printf(\"option b\\[rs]n\");\n"
1155 " break;\n"
1156 "\\&\n"
1157 " case \\[aq]c\\[aq]:\n"
1158 " printf(\"option c with value \\[aq]%s\\[aq]\\[rs]n\", optarg);\n"
1159 " break;\n"
1160 "\\&\n"
1161 " case \\[aq]d\\[aq]:\n"
1162 " printf(\"option d with value \\[aq]%s\\[aq]\\[rs]n\", optarg);\n"
1163 " break;\n"
1164 "\\&\n"
1165 " case \\[aq]?\\[aq]:\n"
1166 " break;\n"
1167 "\\&\n"
1168 " default:\n"
1169 " printf(\"?? getopt returned character code 0%o ??\\[rs]n\", c);\n"
1170 " }\n"
1171 " }\n"
1172 "\\&\n"
1173 " if (optind E<lt> argc) {\n"
1174 " printf(\"non-option ARGV-elements: \");\n"
1175 " while (optind E<lt> argc)\n"
1176 " printf(\"%s \", argv[optind++]);\n"
1177 " printf(\"\\[rs]n\");\n"
1178 " }\n"
1179 "\\&\n"
1180 " exit(EXIT_SUCCESS);\n"
1181 "}\n"
1182 msgstr ""
1183
1184 #. type: Plain text
1185 #: debian-trixie fedora-44 fedora-rawhide
1186 msgid "B<getopt>(1), B<getsubopt>(3)"
1187 msgstr "B<getopt>(1), B<getsubopt>(3)"
1188
1189 #. type: TH
1190 #: fedora-44 fedora-rawhide
1191 #, no-wrap
1192 msgid "2024-12-19"
1193 msgstr "19 Diciembre 2024"
1194
1195 #. type: TH
1196 #: fedora-44 fedora-rawhide
1197 #, no-wrap
1198 msgid "Linux man-pages 6.13"
1199 msgstr "Páginas de Manual de Linux 6.13"
1200
1201 #. type: Plain text
1202 #: fedora-44 fedora-rawhide
1203 msgid ""
1204 "Very old versions of glibc were affected by a E<.UR https://"
1205 "\\:sourceware.org/\\:git/\\:?"
1206 "p=glibc.git;a=commitdiff;h=bf079e19f50d64aa5e05> "
1207 "B<_>I<PID>B<_GNU_nonoption_argv_flags_> environment variable E<.UE .>"
1208 msgstr ""
1209
1210 #. type: TH
1211 #: mageia-cauldron
1212 #, no-wrap
1213 msgid "Linux man-pages 6.17"
1214 msgstr "Páginas de Manual de Linux 6.17"
1215
1216 #. type: TH
1217 #: opensuse-leap-16-1 opensuse-tumbleweed
1218 #, no-wrap
1219 msgid "Linux man-pages (unreleased)"
1220 msgstr "Páginas de Manual de Linux (no publicadas)"