Debian Codegraph @

po/ru/man3/getopt.3.po

raw
1 # Russian translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Azamat Hackimov <[email protected]>, 2013-2014, 2017.
5 # Dmitry Bolkhovskikh <[email protected]>, 2017.
6 # Vladislav <[email protected]>, 2015.
7 # Yuri Kozlov <[email protected]>, 2011-2019.
8 # Иван Павлов <[email protected]>, 2017, 2019.
9 msgid ""
10 msgstr ""
11 "Project-Id-Version: manpages-l10n\n"
12 "POT-Creation-Date: 2026-06-05 06:25+0200\n"
13 "PO-Revision-Date: 2024-12-21 19:50+0300\n"
14 "Last-Translator: Yuri Kozlov <[email protected]>\n"
15 "Language-Team: Russian <[email protected]>\n"
16 "Language: ru\n"
17 "MIME-Version: 1.0\n"
18 "Content-Type: text/plain; charset=UTF-8\n"
19 "Content-Transfer-Encoding: 8bit\n"
20 "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
21 "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || "
22 "(n%100>=11 && n%100<=14)? 2 : 3);\n"
23 "X-Generator: Lokalize 2.0\n"
24
25 #. type: TH
26 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
27 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
28 #, fuzzy, no-wrap
29 #| msgid "getopt()"
30 msgid "getopt"
31 msgstr "getopt()"
32
33 #. type: TH
34 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
35 #: opensuse-tumbleweed
36 #, no-wrap
37 msgid "2026-02-08"
38 msgstr "8 февраля 2026 г."
39
40 #. type: TH
41 #: archlinux debian-unstable
42 #, fuzzy, no-wrap
43 #| msgid "Linux man-pages 6.17"
44 msgid "Linux man-pages 6.18"
45 msgstr "Справочные страницы Linux 6.17"
46
47 #. type: SH
48 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
49 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
50 #, no-wrap
51 msgid "NAME"
52 msgstr "НАИМЕНОВАНИЕ"
53
54 #. type: Plain text
55 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
56 #: opensuse-tumbleweed
57 #, fuzzy
58 #| msgid ""
59 #| "getopt, getopt_long, getopt_long_only, optarg, optind, opterr, optopt - "
60 #| "Parse command-line options"
61 msgid "getopt, optarg, optind, opterr, optopt - Parse command-line options"
62 msgstr ""
63 "getopt, getopt_long, getopt_long_only, optarg, optind, opterr, optopt - "
64 "разбираю параметры командной строки"
65
66 #. type: SH
67 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
68 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
69 #, no-wrap
70 msgid "LIBRARY"
71 msgstr "БИБЛИОТЕКА"
72
73 #. type: Plain text
74 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
75 #: opensuse-leap-16-1 opensuse-tumbleweed
76 msgid "Standard C library (I<libc>,\\ I<-lc>)"
77 msgstr "Стандартная библиотека языка C (I<libc>,\\ I<-lc>)"
78
79 #. type: SH
80 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
81 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
82 #, no-wrap
83 msgid "SYNOPSIS"
84 msgstr "СИНТАКСИС"
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 #, no-wrap
90 msgid "B<#include E<lt>unistd.hE<gt>>\n"
91 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
92
93 #. type: Plain text
94 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
95 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
96 #, fuzzy, no-wrap
97 #| msgid ""
98 #| "B<int getopt(int >I<argc>B<, char * const >I<argv[]>B<,>\n"
99 #| "B< const char *>I<optstring>B<);>\n"
100 msgid ""
101 "B<int getopt(int >I<argc>B<, char *>I<argv>B<[],>\n"
102 "B< const char *>I<optstring>B<);>\n"
103 msgstr ""
104 "B<int getopt(int >I<argc>B<, char * const >I<argv[]>B<,>\n"
105 "B< const char *>I<optstring>B<);>\n"
106
107 #. type: Plain text
108 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
109 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
110 #, no-wrap
111 msgid ""
112 "B<extern char *>I<optarg>B<;>\n"
113 "B<extern int >I<optind>B<, >I<opterr>B<, >I<optopt>B<;>\n"
114 msgstr ""
115 "B<extern char *>I<optarg>B<;>\n"
116 "B<extern int >I<optind>B<, >I<opterr>B<, >I<optopt>B<;>\n"
117
118 #. type: Plain text
119 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
120 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
121 msgid ""
122 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
123 msgstr ""
124 "Требования макроса тестирования свойств для glibc (см. "
125 "B<feature_test_macros>(7)):"
126
127 #. type: Plain text
128 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
129 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
130 msgid "B<getopt>():"
131 msgstr "B<getopt>():"
132
133 #. type: Plain text
134 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
135 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
136 #, no-wrap
137 msgid " _POSIX_C_SOURCE E<gt>= 2 || _XOPEN_SOURCE\n"
138 msgstr " _POSIX_C_SOURCE E<gt>= 2 || _XOPEN_SOURCE\n"
139
140 #. type: SH
141 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
142 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
143 #, no-wrap
144 msgid "DESCRIPTION"
145 msgstr "ОПИСАНИЕ"
146
147 #. type: Plain text
148 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
149 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
150 #, fuzzy
151 #| msgid ""
152 #| "The B<getopt>() function parses the command-line arguments. Its "
153 #| "arguments I<argc> and I<argv> are the argument count and array as passed "
154 #| "to the I<main>() function on program invocation. An element of I<argv> "
155 #| "that starts with \\(aq-\\(aq (and is not exactly \"-\" or \"--\") is an "
156 #| "option element. The characters of this element (aside from the initial \\"
157 #| "(aq-\\(aq) are option characters. If B<getopt>() is called repeatedly, "
158 #| "it returns successively each of the option characters from each of the "
159 #| "option elements."
160 msgid ""
161 "The B<getopt>() function parses the command-line arguments. Its arguments "
162 "I<argc> and I<argv> are the argument count and array as passed to the "
163 "I<main>() function on program invocation. An element of I<argv> that "
164 "starts with \\[aq]-\\[aq] (and is not exactly \"-\" or \"--\") is an option "
165 "element. The characters of this element (aside from the initial \\[aq]-\\"
166 "[aq]) are option characters. If B<getopt>() is called repeatedly, it "
167 "returns successively each of the option characters from each of the option "
168 "elements."
169 msgstr ""
170 "Функция B<getopt>() разбирает аргументы командной строки. Её аргументы "
171 "I<argc> и I<argv> являются счётчиком и массивом аргументов, которые "
172 "передаются функции I<main>() при запуске программы. Элемент I<argv>, "
173 "начинающийся с «-» (и не являющийся «-» или «--»), считается параметром. "
174 "Символы этого элемента (не считая начального «-») являются символами "
175 "параметра. При каждом повторном вызове B<getopt>() возвращают следующий "
176 "символ параметра и так для каждого следующего параметра."
177
178 #. type: Plain text
179 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
180 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
181 msgid ""
182 "The variable I<optind> is the index of the next element to be processed in "
183 "I<argv>. The system initializes this value to 1. The caller can reset it "
184 "to 1 to restart scanning of the same I<argv>, or when scanning a new "
185 "argument vector."
186 msgstr ""
187 "Переменная I<optind> — это индекс следующего обрабатываемого элемента "
188 "I<argv>. Система инициализирует это значение 1. Вызывающий может сбросить "
189 "его в 1 для перезапуска сканирования того же I<argv>, или при сканировании "
190 "нового вектора аргументов."
191
192 #. type: Plain text
193 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
194 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
195 msgid ""
196 "If B<getopt>() finds another option character, it returns that character, "
197 "updating the external variable I<optind> and a static variable I<nextchar> "
198 "so that the next call to B<getopt>() can resume the scan with the following "
199 "option character or I<argv>-element."
200 msgstr ""
201 "Если B<getopt>() встречает символ другого параметра, она возвращает этот "
202 "символ, обновляя внешнюю переменную I<optind> и статическую переменную "
203 "I<nextchar>, так что следующий вызов B<getopt>() может продолжить проверку с "
204 "символа следующего параметра или элемента I<argv>."
205
206 #. type: Plain text
207 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
208 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
209 msgid ""
210 "If there are no more option characters, B<getopt>() returns -1. Then "
211 "I<optind> is the index in I<argv> of the first I<argv>-element that is not "
212 "an option."
213 msgstr ""
214 "Если символов параметров больше нет, то B<getopt>() возвращает -1. При этом "
215 "I<optind> станет индексом первого элемента I<argv>, не являющегося "
216 "параметром."
217
218 #. type: Plain text
219 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
220 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
221 #, fuzzy
222 #| msgid ""
223 #| "I<optstring> is a string containing the legitimate option characters. If "
224 #| "such a character is followed by a colon, the option requires an argument, "
225 #| "so B<getopt>() places a pointer to the following text in the same "
226 #| "I<argv>-element, or the text of the following I<argv>-element, in "
227 #| "I<optarg>. Two colons mean an option takes an optional arg; if there is "
228 #| "text in the current I<argv>-element (i.e., in the same word as the option "
229 #| "name itself, for example, \"-oarg\"), then it is returned in I<optarg>, "
230 #| "otherwise I<optarg> is set to zero. This is a GNU extension. If "
231 #| "I<optstring> contains B<W> followed by a semicolon, then B<-W foo> is "
232 #| "treated as the long option B<--foo>. (The B<-W> option is reserved by "
233 #| "POSIX.2 for implementation extensions.) This behavior is a GNU "
234 #| "extension, not available with libraries before glibc 2."
235 msgid ""
236 "I<optstring> is a string containing the legitimate option characters. A "
237 "legitimate option character is any visible one byte B<ascii>(7) character "
238 "(for which B<isgraph>(3) would return nonzero) that is not \\[aq]-\\[aq], \\"
239 "[aq]:\\[aq], or \\[aq];\\[aq]. If such a character is followed by a colon, "
240 "the option requires an argument, so B<getopt>() places a pointer to the "
241 "following text in the same I<argv>-element, or the text of the following "
242 "I<argv>-element, in I<optarg>. Two colons mean an option takes an optional "
243 "arg; if there is text in the current I<argv>-element (i.e., in the same word "
244 "as the option name itself, for example, \"-oarg\"), then it is returned in "
245 "I<optarg>, otherwise I<optarg> is set to zero. This is a GNU extension. If "
246 "I<optstring> contains B<W> followed by a semicolon, then B<-W foo> is "
247 "treated as the long option B<--foo>. (The B<-W> option is reserved by "
248 "POSIX.2 for implementation extensions.) This behavior is a GNU extension, "
249 "not available with libraries before glibc 2."
250 msgstr ""
251 "Аргумент I<optstring> является строкой, содержащей допустимые символы "
252 "параметров. Если за таким символом стоит двоеточие, то параметр требует "
253 "указания аргумента. При этом B<getopt>() помещает указатель на следующий за "
254 "символом параметра текст в тот же элемент I<argv>, или на текст следующего "
255 "элемента I<argv> в I<optarg>. Два двоеточия означают, что параметр имеет "
256 "необязательный аргумент; если текущий элемент I<argv> содержит текст (то "
257 "есть в самом имени слова, например «-oarg»), то он возвращается в I<optarg>, "
258 "в противном случае I<optarg> содержит ноль. Это является расширением GNU. "
259 "Если I<optstring> содержит B<W>, за которой следует точка с запятой, то B<-W "
260 "foo> рассматривается как длинный параметр B<--foo> (параметр B<-W> "
261 "зарезервирован POSIX.2 для реализации расширений). Такое поведение является "
262 "расширением GNU и недоступно в библиотеках до glibc 2."
263
264 #. type: Plain text
265 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
266 #: opensuse-tumbleweed
267 #, fuzzy
268 #| msgid ""
269 #| "By default, B<getopt>() permutes the contents of I<argv> as it scans, so "
270 #| "that eventually all the nonoptions are at the end. Two other modes are "
271 #| "also implemented. If the first character of I<optstring> is \\(aq+\\(aq "
272 #| "or the environment variable B<POSIXLY_CORRECT> is set, then option "
273 #| "processing stops as soon as a nonoption argument is encountered. If the "
274 #| "first character of I<optstring> is \\(aq-\\(aq, then each nonoption "
275 #| "I<argv>-element is handled as if it were the argument of an option with "
276 #| "character code 1. (This is used by programs that were written to expect "
277 #| "options and other I<argv>-elements in any order and that care about the "
278 #| "ordering of the two.) The special argument \"--\" forces an end of "
279 #| "option-scanning regardless of the scanning mode."
280 msgid ""
281 "By default, B<getopt>() permutes the contents of I<argv> as it scans, so "
282 "that eventually all the nonoptions are at the end. Two other scanning modes "
283 "are also implemented. If the first character of I<optstring> is \\[aq]+\\"
284 "[aq] or the environment variable B<\\%POSIXLY_CORRECT> is set, then option "
285 "processing stops as soon as a nonoption argument is encountered. If \\[aq]+"
286 "\\[aq] is not the first character of I<optstring>, it is treated as a normal "
287 "option. If B<\\%POSIXLY_CORRECT> behavior is required in this case "
288 "I<optstring> will contain two \\[aq]+\\[aq] symbols. If the first character "
289 "of I<optstring> is \\[aq]-\\[aq], then each nonoption I<argv>-element is "
290 "handled as if it were the argument of an option with character code 1. "
291 "(This is used by programs that were written to expect options and other "
292 "I<argv>-elements in any order and that care about the ordering of the two.) "
293 "The special argument \"--\" forces an end of option-scanning regardless of "
294 "the scanning mode."
295 msgstr ""
296 "По умолчанию B<getopt>() переставляет элементы содержимого I<argv> в "
297 "процессе поиска, так что в конечном счёте все аргументы, не являющиеся "
298 "параметрами, оказываются в конце. Реализованы также два других режима. Если "
299 "первым символом I<optstring> является «+» или задана переменная окружения "
300 "B<POSIXLY_CORRECT>, то обработка параметров прерывается сразу, как только "
301 "находится символ не параметра. Если первым символом I<optstring> является "
302 "«-», то каждый элемент I<argv>, не являющийся параметром, обрабатывается "
303 "так, как если бы он был аргументом параметра с символом, имеющим код 1 (это "
304 "используется программами, которые требуют параметры и другие элементы "
305 "I<argv> в любом порядке и их порядок важен). Специальный аргумент «--» "
306 "служит для обозначения конца параметров независимо от режима."
307
308 #. type: Plain text
309 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
310 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
311 msgid ""
312 "While processing the option list, B<getopt>() can detect two kinds of "
313 "errors: (1) an option character that was not specified in I<optstring> and "
314 "(2) a missing option argument (i.e., an option at the end of the command "
315 "line without an expected argument). Such errors are handled and reported as "
316 "follows:"
317 msgstr ""
318 "При обработке списка параметров B<getopt>() может определить два типа "
319 "ошибок: (1) — символ параметра, не заданный в I<optstring> и (2) — "
320 "отсутствующий аргумент параметра (т. е., параметра в конце командной строки "
321 "без ожидаемого аргумента). Эти ошибки обрабатываются и о них сообщается "
322 "следующем образом:"
323
324 #. type: IP
325 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
326 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
327 #, no-wrap
328 msgid "\\[bu]"
329 msgstr "\\[bu]"
330
331 #. type: Plain text
332 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
333 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
334 #, fuzzy
335 #| msgid ""
336 #| "By default, B<getopt>() prints an error message on standard error, "
337 #| "places the erroneous option character in I<optopt>, and returns \\(aq?\\"
338 #| "(aq as the function result."
339 msgid ""
340 "By default, B<getopt>() prints an error message on standard error, places "
341 "the erroneous option character in I<optopt>, and returns \\[aq]?\\[aq] as "
342 "the function result."
343 msgstr ""
344 "По умолчанию, B<getopt>() печатает сообщение об ошибке в стандартный поток "
345 "ошибок, помещает ошибочный символ параметра в I<optopt> и возвращает \\(aq?\\"
346 "(aq как результат функции."
347
348 #. type: Plain text
349 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
350 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
351 #, fuzzy
352 #| msgid ""
353 #| "If the caller has set the global variable I<opterr> to zero, then "
354 #| "B<getopt>() does not print an error message. The caller can determine "
355 #| "that there was an error by testing whether the function return value is \\"
356 #| "(aq?\\(aq. (By default, I<opterr> has a nonzero value.)"
357 msgid ""
358 "If the caller has set the global variable I<opterr> to zero, then "
359 "B<getopt>() does not print an error message. The caller can determine that "
360 "there was an error by testing whether the function return value is \\[aq]?\\"
361 "[aq]. (By default, I<opterr> has a nonzero value.)"
362 msgstr ""
363 "Если вызывающий присвоил глобальной переменной I<opterr> значение 0, то "
364 "B<getopt>() не печатает сообщение об ошибке. Вызывающий может определить, "
365 "что произошла ошибка, сравнив возвращаемое значение функции с \\(aq?\\(aq "
366 "(по умолчанию I<opterr> имеет ненулевое значение)."
367
368 #. type: Plain text
369 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
370 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
371 #, fuzzy
372 #| msgid ""
373 #| "If the first character (following any optional \\(aq+\\(aq or \\(aq-\\(aq "
374 #| "described above) of I<optstring> is a colon (\\(aq:\\(aq), then "
375 #| "B<getopt>() likewise does not print an error message. In addition, it "
376 #| "returns \\(aq:\\(aq instead of \\(aq?\\(aq to indicate a missing option "
377 #| "argument. This allows the caller to distinguish the two different types "
378 #| "of errors."
379 msgid ""
380 "If the first character (following any optional \\[aq]+\\[aq] or \\[aq]-\\"
381 "[aq] described above) of I<optstring> is a colon (\\[aq]:\\[aq]), then "
382 "B<getopt>() likewise does not print an error message. In addition, it "
383 "returns \\[aq]:\\[aq] instead of \\[aq]?\\[aq] to indicate a missing option "
384 "argument. This allows the caller to distinguish the two different types of "
385 "errors."
386 msgstr ""
387 "Если первый символ (после необязательных \\(aq+\\(aq или \\(aq-\\(aq, "
388 "описанных выше) I<optstring> — двоеточие (\\(aq:\\(aq), то B<getopt>() также "
389 "не печатает сообщение об ошибке. При этом возвращается \\(aq:\\(aq вместо \\"
390 "(aq?\\(aq, что показывает отсутствие аргумента параметра. Это позволяет "
391 "вызывающему отличить один тип ошибок от другого."
392
393 #. type: SH
394 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
395 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
396 #, no-wrap
397 msgid "RETURN VALUE"
398 msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ"
399
400 #. type: Plain text
401 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
402 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
403 #, fuzzy
404 #| msgid ""
405 #| "If an option was successfully found, then B<getopt>() returns the option "
406 #| "character. If all command-line options have been parsed, then "
407 #| "B<getopt>() returns -1. If B<getopt>() encounters an option character "
408 #| "that was not in I<optstring>, then \\(aq?\\(aq is returned. If "
409 #| "B<getopt>() encounters an option with a missing argument, then the "
410 #| "return value depends on the first character in I<optstring>: if it is \\"
411 #| "(aq:\\(aq, then \\(aq:\\(aq is returned; otherwise \\(aq?\\(aq is "
412 #| "returned."
413 msgid ""
414 "If an option was successfully found, then B<getopt>() returns the option "
415 "character. If all command-line options have been parsed, then B<getopt>() "
416 "returns -1. If B<getopt>() encounters an option character that was not in "
417 "I<optstring>, then \\[aq]?\\[aq] is returned. If B<getopt>() encounters an "
418 "option with a missing argument, then the return value depends on the first "
419 "character in I<optstring>: if it is \\[aq]:\\[aq], then \\[aq]:\\[aq] is "
420 "returned; otherwise \\[aq]?\\[aq] is returned."
421 msgstr ""
422 "Если параметр найден, то B<getopt>() возвращает символ параметра. Если все "
423 "параметры командной строки обработаны, то B<getopt>() возвращает -1. Если "
424 "B<getopt>() находит символ, которого нет в I<optstring>, то возвращается "
425 "«?». Если B<getopt>() находит символ с отсутствующим аргументом, то "
426 "возвращаемое значение зависит от первого символа I<optstring>: если это «:», "
427 "то возвращается «:», в противном случае возвращается «?»."
428
429 #. type: SH
430 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
431 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
432 #, no-wrap
433 msgid "ENVIRONMENT"
434 msgstr "СРЕДА ОКРУЖЕНИЯ"
435
436 #. type: TP
437 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
438 #: opensuse-tumbleweed
439 #, fuzzy, no-wrap
440 #| msgid "B<POSIXLY_CORRECT>"
441 msgid "B<\\%POSIXLY_CORRECT>"
442 msgstr "B<POSIXLY_CORRECT>"
443
444 #. type: Plain text
445 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
446 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
447 msgid ""
448 "If this is set, then option processing stops as soon as a nonoption argument "
449 "is encountered."
450 msgstr ""
451 "Если установлена эта переменная, то обработка параметров прерывается на "
452 "первом аргументе, не являющемся параметром."
453
454 #. type: SH
455 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
456 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
457 #, no-wrap
458 msgid "ATTRIBUTES"
459 msgstr "АТРИБУТЫ"
460
461 #. type: Plain text
462 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
463 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
464 msgid ""
465 "For an explanation of the terms used in this section, see B<attributes>(7)."
466 msgstr "Описание терминов данного раздела смотрите в B<attributes>(7)."
467
468 #. type: tbl table
469 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
470 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
471 #, no-wrap
472 msgid "Interface"
473 msgstr "Интерфейс"
474
475 #. type: tbl table
476 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
477 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
478 #, no-wrap
479 msgid "Attribute"
480 msgstr "Атрибут"
481
482 #. type: tbl table
483 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
484 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
485 #, no-wrap
486 msgid "Value"
487 msgstr "Значение"
488
489 #. type: tbl table
490 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
491 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
492 #, no-wrap
493 msgid ".na\n"
494 msgstr ".na\n"
495
496 #. type: tbl table
497 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
498 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
499 #, no-wrap
500 msgid ".nh\n"
501 msgstr ".nh\n"
502
503 #. type: TP
504 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
505 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
506 #, fuzzy, no-wrap
507 #| msgid "B<getopt>():"
508 msgid "B<getopt>()"
509 msgstr "B<getopt>():"
510
511 #. type: tbl table
512 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
513 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
514 #, no-wrap
515 msgid "Thread safety"
516 msgstr "Безвредность в нитях"
517
518 #. type: tbl table
519 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
520 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
521 #, no-wrap
522 msgid "MT-Unsafe race:getopt env"
523 msgstr "MT-Unsafe race:getopt env"
524
525 #. type: SH
526 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
527 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
528 #, no-wrap
529 msgid "VERSIONS"
530 msgstr "ВЕРСИИ"
531
532 #. type: Plain text
533 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
534 #: opensuse-tumbleweed
535 msgid ""
536 "POSIX specifies that the I<argv> array argument should be I<const>, but "
537 "these functions permute its elements unless the environment variable B<\\"
538 "%POSIXLY_CORRECT> is set. I<const> is used in the actual prototype to be "
539 "compatible with other systems; however, this page doesn't show the "
540 "qualifier, to avoid confusing readers."
541 msgstr ""
542
543 #. type: SH
544 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
545 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
546 #, no-wrap
547 msgid "STANDARDS"
548 msgstr "СТАНДАРТЫ"
549
550 #. type: Plain text
551 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
552 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
553 msgid "POSIX.1-2008."
554 msgstr "POSIX.1-2008."
555
556 #. type: Plain text
557 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
558 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
559 #, fuzzy
560 #| msgid ""
561 #| "The use of \\(aq+\\(aq and \\(aq-\\(aq in I<optstring> is a GNU extension."
562 msgid ""
563 "The use of \\[aq]+\\[aq] and \\[aq]-\\[aq] in I<optstring> is a GNU "
564 "extension."
565 msgstr "Использование «+» и «-» в I<optstring> является расширением GNU."
566
567 #. type: SH
568 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
569 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
570 #, no-wrap
571 msgid "HISTORY"
572 msgstr "ИСТОРИЯ"
573
574 #. type: Plain text
575 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
576 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
577 #, fuzzy
578 #| msgid "POSIX.1-2001, POSIX.1-2008."
579 msgid "POSIX.1-2001, and POSIX.2."
580 msgstr "POSIX.1-2001, POSIX.1-2008."
581
582 #. type: Plain text
583 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
584 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
585 msgid ""
586 "On some older implementations, B<getopt>() was declared in "
587 "I<E<lt>stdio.hE<gt>>. SUSv1 permitted the declaration to appear in either "
588 "I<E<lt>unistd.hE<gt>> or I<E<lt>stdio.hE<gt>>. POSIX.1-1996 marked the use "
589 "of I<E<lt>stdio.hE<gt>> for this purpose as LEGACY. POSIX.1-2001 does not "
590 "require the declaration to appear in I<E<lt>stdio.hE<gt>>."
591 msgstr ""
592 "В некоторых старых реализациях B<getopt>() объявлялась в "
593 "I<E<lt>stdio.hE<gt>>. В SUSv1 разрешено её объявлять в I<E<lt>unistd.hE<gt>> "
594 "или I<E<lt>stdio.hE<gt>>. В POSIX.1-1996 отмечено, что использование "
595 "I<E<lt>stdio.hE<gt>> УСТАРЕЛО. В POSIX.1-2001 не требуется объявлять эту "
596 "функцию в I<E<lt>stdio.hE<gt>>."
597
598 #. type: Plain text
599 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
600 #: opensuse-tumbleweed
601 msgid ""
602 "Very old versions of glibc were affected by a E<.UR https:\\://"
603 "\\:sourceware.org/\\:git/\\:?"
604 "p=glibc.git;a=commitdiff;h=bf079e19f50d64aa5e05> B<\\"
605 "%_>I<PID>B<_GNU_nonoption_argv_flags_> environment variable E<.UE .>"
606 msgstr ""
607
608 #. type: SH
609 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
610 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
611 #, no-wrap
612 msgid "NOTES"
613 msgstr "ПРИМЕЧАНИЯ"
614
615 #. type: Plain text
616 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
617 #: opensuse-tumbleweed
618 #, fuzzy
619 #| msgid ""
620 #| "A program that scans multiple argument vectors, or rescans the same "
621 #| "vector more than once, and wants to make use of GNU extensions such as \\"
622 #| "(aq+\\(aq and \\(aq-\\(aq at the start of I<optstring>, or changes the "
623 #| "value of B<POSIXLY_CORRECT> between scans, must reinitialize B<getopt>() "
624 #| "by resetting I<optind> to 0, rather than the traditional value of 1. "
625 #| "(Resetting to 0 forces the invocation of an internal initialization "
626 #| "routine that rechecks B<POSIXLY_CORRECT> and checks for GNU extensions in "
627 #| "I<optstring>.)"
628 msgid ""
629 "A program that scans multiple argument vectors, or rescans the same vector "
630 "more than once, and wants to make use of GNU extensions such as \\[aq]+\\"
631 "[aq] and \\[aq]-\\[aq] at the start of I<optstring>, or changes the value of "
632 "B<\\%POSIXLY_CORRECT> between scans, must reinitialize B<getopt>() by "
633 "resetting I<optind> to 0, rather than the traditional value of 1. "
634 "(Resetting to 0 forces the invocation of an internal initialization routine "
635 "that rechecks B<\\%POSIXLY_CORRECT> and checks for GNU extensions in "
636 "I<optstring>.)"
637 msgstr ""
638 "В программе, где анализируется несколько векторов параметров, или "
639 "разбирается один вектор более одного раза и нужно использовать расширения "
640 "GNU «+» и «-» в начале I<optstring> или изменять значение B<POSIXLY_CORRECT> "
641 "между разборами, должна повторно инициализировать B<getopt>() сбрасывая "
642 "I<optind> в 0, а не в обычное значение 1 (сброс в 0 вызывает принудительный "
643 "вызов внутренней процедуры, повторно проверяющей B<POSIXLY_CORRECT> и "
644 "расширения GNU в I<optstring>)."
645
646 #. type: Plain text
647 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
648 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
649 msgid ""
650 "Command-line arguments are parsed in strict order meaning that an option "
651 "requiring an argument will consume the next argument, regardless of whether "
652 "that argument is the correctly specified option argument or simply the next "
653 "option (in the scenario the user mis-specifies the command line). For "
654 "example, if I<optstring> is specified as \"1n:\" and the user specifies the "
655 "command line arguments incorrectly as I<prog\\ -n\\ -1>, the I<-n> option "
656 "will be given the B<optarg> value \"-1\", and the I<-1> option will be "
657 "considered to have not been specified."
658 msgstr ""
659
660 #. type: SH
661 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
662 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
663 #, no-wrap
664 msgid "EXAMPLES"
665 msgstr "ПРИМЕРЫ"
666
667 #. type: SS
668 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
669 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
670 #, no-wrap
671 msgid "getopt()"
672 msgstr "getopt()"
673
674 #. type: Plain text
675 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
676 #: opensuse-tumbleweed
677 #, fuzzy
678 #| msgid ""
679 #| "The following trivial example program uses B<getopt>() to handle two "
680 #| "program options: I<-n>, with no associated value; and I<-t val>, which "
681 #| "expects an associated value."
682 msgid ""
683 "The following trivial example program uses B<getopt>() to handle two "
684 "program options: I<-n>, with no associated value; and I<-t\\ val>, which "
685 "expects an associated value."
686 msgstr ""
687 "В приведённом ниже пример программы B<getopt>() используется два параметра "
688 "программы: I<-n> без значения и I<-t значение> со значением."
689
690 #. type: Plain text
691 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
692 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
693 #, fuzzy, no-wrap
694 #| msgid ""
695 #| " nsecs = 0;\n"
696 #| " tfnd = 0;\n"
697 #| " flags = 0;\n"
698 #| " while ((opt = getopt(argc, argv, \"nt:\")) != -1) {\n"
699 #| " switch (opt) {\n"
700 #| " case \\(aqn\\(aq:\n"
701 #| " flags = 1;\n"
702 #| " break;\n"
703 #| " case \\(aqt\\(aq:\n"
704 #| " nsecs = atoi(optarg);\n"
705 #| " tfnd = 1;\n"
706 #| " break;\n"
707 #| " default: /* \\(aq?\\(aq */\n"
708 #| " fprintf(stderr, \"Usage: %s [-t nsecs] [-n] name\\en\",\n"
709 #| " argv[0]);\n"
710 #| " exit(EXIT_FAILURE);\n"
711 #| " }\n"
712 #| " }\n"
713 msgid ""
714 "#include E<lt>stdio.hE<gt>\n"
715 "#include E<lt>stdlib.hE<gt>\n"
716 "#include E<lt>unistd.hE<gt>\n"
717 "\\&\n"
718 "int\n"
719 "main(int argc, char *argv[])\n"
720 "{\n"
721 " int flags, opt;\n"
722 " int nsecs, tfnd;\n"
723 "\\&\n"
724 " nsecs = 0;\n"
725 " tfnd = 0;\n"
726 " flags = 0;\n"
727 " while ((opt = getopt(argc, argv, \"nt:\")) != -1) {\n"
728 " switch (opt) {\n"
729 " case \\[aq]n\\[aq]:\n"
730 " flags = 1;\n"
731 " break;\n"
732 " case \\[aq]t\\[aq]:\n"
733 " nsecs = atoi(optarg);\n"
734 " tfnd = 1;\n"
735 " break;\n"
736 " default: /* \\[aq]?\\[aq] */\n"
737 " fprintf(stderr, \"Usage: %s [-t nsecs] [-n] name\\[rs]n\",\n"
738 " argv[0]);\n"
739 " exit(EXIT_FAILURE);\n"
740 " }\n"
741 " }\n"
742 "\\&\n"
743 " printf(\"flags=%d; tfnd=%d; nsecs=%d; optind=%d\\[rs]n\",\n"
744 " flags, tfnd, nsecs, optind);\n"
745 "\\&\n"
746 " if (optind E<gt>= argc) {\n"
747 " fprintf(stderr, \"Expected argument after options\\[rs]n\");\n"
748 " exit(EXIT_FAILURE);\n"
749 " }\n"
750 "\\&\n"
751 " printf(\"name argument = %s\\[rs]n\", argv[optind]);\n"
752 "\\&\n"
753 " /* Other code omitted */\n"
754 "\\&\n"
755 " exit(EXIT_SUCCESS);\n"
756 "}\n"
757 msgstr ""
758 " nsecs = 0;\n"
759 " tfnd = 0;\n"
760 " flags = 0;\n"
761 " while ((opt = getopt(argc, argv, \"nt:\")) != -1) {\n"
762 " switch (opt) {\n"
763 " case \\(aqn\\(aq:\n"
764 " flags = 1;\n"
765 " break;\n"
766 " case \\(aqt\\(aq:\n"
767 " nsecs = atoi(optarg);\n"
768 " tfnd = 1;\n"
769 " break;\n"
770 " default: /* \\(aq?\\(aq */\n"
771 " fprintf(stderr, \"Использование: %s [-t nsecs] [-n] имя\\en\",\n"
772 " argv[0]);\n"
773 " exit(EXIT_FAILURE);\n"
774 " }\n"
775 " }\n"
776
777 #. SRC END
778 #. type: SH
779 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
780 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
781 #, no-wrap
782 msgid "SEE ALSO"
783 msgstr "СМОТРИТЕ ТАКЖЕ"
784
785 #. type: Plain text
786 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
787 #: opensuse-tumbleweed
788 #, fuzzy
789 #| msgid ""
790 #| "B<getopt>(),\n"
791 #| "B<getopt_long>(),\n"
792 #| "B<getopt_long_only>()"
793 msgid ""
794 "B<getopt>(1), B<getopt_long>(3), B<getopt_long_only>(3), B<getsubopt>(3)"
795 msgstr ""
796 "B<getopt>(),\n"
797 "B<getopt_long>(),\n"
798 "B<getopt_long_only>()"
799
800 #. type: TH
801 #: debian-trixie
802 #, no-wrap
803 msgid "2024-06-15"
804 msgstr "15 июня 2024 г."
805
806 #. type: TH
807 #: debian-trixie
808 #, no-wrap
809 msgid "Linux man-pages 6.9.1"
810 msgstr "Страницы руководства Linux 6.9.1"
811
812 #. type: Plain text
813 #: debian-trixie fedora-44 fedora-rawhide
814 msgid ""
815 "getopt, getopt_long, getopt_long_only, optarg, optind, opterr, optopt - "
816 "Parse command-line options"
817 msgstr ""
818 "getopt, getopt_long, getopt_long_only, optarg, optind, opterr, optopt - "
819 "разбираю параметры командной строки"
820
821 #. type: Plain text
822 #: debian-trixie
823 msgid "Standard C library (I<libc>, I<-lc>)"
824 msgstr "Стандартная библиотека языка C (I<libc>, I<-lc>)"
825
826 #. type: Plain text
827 #: debian-trixie fedora-44 fedora-rawhide
828 #, no-wrap
829 msgid "B<#include E<lt>getopt.hE<gt>>\n"
830 msgstr "B<#include E<lt>getopt.hE<gt>>\n"
831
832 #. type: Plain text
833 #: debian-trixie fedora-44 fedora-rawhide
834 #, fuzzy, no-wrap
835 #| msgid ""
836 #| "B<int getopt_long_only(int >I<argc>B<, char * const >I<argv[]>B<,>\n"
837 #| "B< const char *>I<optstring>B<,>\n"
838 #| "B< const struct option *>I<longopts>B<, int *>I<longindex>B<);>\n"
839 msgid ""
840 "B<int getopt_long(int >I<argc>B<, char *>I<argv>B<[],>\n"
841 "B< const char *>I<optstring>B<,>\n"
842 "B< const struct option *>I<longopts>B<, int *>I<longindex>B<);>\n"
843 "B<int getopt_long_only(int >I<argc>B<, char *>I<argv>B<[],>\n"
844 "B< const char *>I<optstring>B<,>\n"
845 "B< const struct option *>I<longopts>B<, int *>I<longindex>B<);>\n"
846 msgstr ""
847 "B<int getopt_long_only(int >I<argc>B<, char * const >I<argv[]>B<,>\n"
848 "B< const char *>I<optstring>B<,>\n"
849 "B< const struct option *>I<longopts>B<, int *>I<longindex>B<);>\n"
850
851 #. type: Plain text
852 #: debian-trixie fedora-44 fedora-rawhide
853 #, fuzzy
854 #| msgid "B<getopt_long>() and B<getopt_long_only>():"
855 msgid "B<getopt_long>(), B<getopt_long_only>():"
856 msgstr "B<getopt_long>() и B<getopt_long_only>():"
857
858 #. type: Plain text
859 #: debian-trixie fedora-44 fedora-rawhide
860 #, no-wrap
861 msgid " _GNU_SOURCE\n"
862 msgstr " _GNU_SOURCE\n"
863
864 #. type: Plain text
865 #: debian-trixie fedora-44 fedora-rawhide
866 #, fuzzy
867 #| msgid ""
868 #| "By default, B<getopt>() permutes the contents of I<argv> as it scans, so "
869 #| "that eventually all the nonoptions are at the end. Two other modes are "
870 #| "also implemented. If the first character of I<optstring> is \\(aq+\\(aq "
871 #| "or the environment variable B<POSIXLY_CORRECT> is set, then option "
872 #| "processing stops as soon as a nonoption argument is encountered. If the "
873 #| "first character of I<optstring> is \\(aq-\\(aq, then each nonoption "
874 #| "I<argv>-element is handled as if it were the argument of an option with "
875 #| "character code 1. (This is used by programs that were written to expect "
876 #| "options and other I<argv>-elements in any order and that care about the "
877 #| "ordering of the two.) The special argument \"--\" forces an end of "
878 #| "option-scanning regardless of the scanning mode."
879 msgid ""
880 "By default, B<getopt>() permutes the contents of I<argv> as it scans, so "
881 "that eventually all the nonoptions are at the end. Two other scanning modes "
882 "are also implemented. If the first character of I<optstring> is \\[aq]+\\"
883 "[aq] or the environment variable B<POSIXLY_CORRECT> is set, then option "
884 "processing stops as soon as a nonoption argument is encountered. If \\[aq]+"
885 "\\[aq] is not the first character of I<optstring>, it is treated as a normal "
886 "option. If B<POSIXLY_CORRECT> behaviour is required in this case "
887 "I<optstring> will contain two \\[aq]+\\[aq] symbols. If the first character "
888 "of I<optstring> is \\[aq]-\\[aq], then each nonoption I<argv>-element is "
889 "handled as if it were the argument of an option with character code 1. "
890 "(This is used by programs that were written to expect options and other "
891 "I<argv>-elements in any order and that care about the ordering of the two.) "
892 "The special argument \"--\" forces an end of option-scanning regardless of "
893 "the scanning mode."
894 msgstr ""
895 "По умолчанию B<getopt>() переставляет элементы содержимого I<argv> в "
896 "процессе поиска, так что в конечном счёте все аргументы, не являющиеся "
897 "параметрами, оказываются в конце. Реализованы также два других режима. Если "
898 "первым символом I<optstring> является «+» или задана переменная окружения "
899 "B<POSIXLY_CORRECT>, то обработка параметров прерывается сразу, как только "
900 "находится символ не параметра. Если первым символом I<optstring> является "
901 "«-», то каждый элемент I<argv>, не являющийся параметром, обрабатывается "
902 "так, как если бы он был аргументом параметра с символом, имеющим код 1 (это "
903 "используется программами, которые требуют параметры и другие элементы "
904 "I<argv> в любом порядке и их порядок важен). Специальный аргумент «--» "
905 "служит для обозначения конца параметров независимо от режима."
906
907 #. type: SS
908 #: debian-trixie fedora-44 fedora-rawhide
909 #, no-wrap
910 msgid "getopt_long() and getopt_long_only()"
911 msgstr "getopt_long() и getopt_long_only()"
912
913 #. type: Plain text
914 #: debian-trixie fedora-44 fedora-rawhide
915 msgid ""
916 "The B<getopt_long>() function works like B<getopt>() except that it also "
917 "accepts long options, started with two dashes. (If the program accepts only "
918 "long options, then I<optstring> should be specified as an empty string "
919 "(\"\"), not NULL.) Long option names may be abbreviated if the abbreviation "
920 "is unique or is an exact match for some defined option. A long option may "
921 "take a parameter, of the form B<--arg=param> or B<--arg param>."
922 msgstr ""
923 "Функция B<getopt_long>() работает так же, как B<getopt>(), за исключением "
924 "того, что она воспринимает и длинные параметры, начинающиеся с двух дефисов "
925 "(если программа принимает только длинные параметры, то значение I<optstring> "
926 "должно быть равно пустой строке (\"\"), не NULL). Длинные параметры можно "
927 "сокращать, если сокращение сохраняет уникальность параметра или полностью "
928 "совпадает с одним из определённых параметров. Длинный параметр может иметь "
929 "значение вида B<--параметр=значение> или B<--параметр значение>."
930
931 #. type: Plain text
932 #: debian-trixie fedora-44 fedora-rawhide
933 msgid ""
934 "I<longopts> is a pointer to the first element of an array of I<struct "
935 "option> declared in I<E<lt>getopt.hE<gt>> as"
936 msgstr ""
937 "Аргумент I<longopts> является указателем на первый элемент массива структур "
938 "I<struct option>, объявленного в I<E<lt>getopt.hE<gt>> следующим образом"
939
940 #. type: Plain text
941 #: debian-trixie fedora-44 fedora-rawhide
942 #, no-wrap
943 msgid ""
944 "struct option {\n"
945 " const char *name;\n"
946 " int has_arg;\n"
947 " int *flag;\n"
948 " int val;\n"
949 "};\n"
950 msgstr ""
951 "struct option {\n"
952 " const char *name;\n"
953 " int has_arg;\n"
954 " int *flag;\n"
955 " int val;\n"
956 "};\n"
957
958 #. type: Plain text
959 #: debian-trixie fedora-44 fedora-rawhide
960 msgid "The meanings of the different fields are:"
961 msgstr "Значения различных полей:"
962
963 #. type: TP
964 #: debian-trixie fedora-44 fedora-rawhide
965 #, no-wrap
966 msgid "I<name>"
967 msgstr "I<имя>"
968
969 #. type: Plain text
970 #: debian-trixie fedora-44 fedora-rawhide
971 msgid "is the name of the long option."
972 msgstr "имя длинного параметра"
973
974 #. type: TP
975 #: debian-trixie fedora-44 fedora-rawhide
976 #, no-wrap
977 msgid "I<has_arg>"
978 msgstr "I<has_arg>"
979
980 #. type: Plain text
981 #: debian-trixie fedora-44 fedora-rawhide
982 msgid ""
983 "is: B<no_argument> (or 0) if the option does not take an argument; "
984 "B<required_argument> (or 1) if the option requires an argument; or "
985 "B<optional_argument> (or 2) if the option takes an optional argument."
986 msgstr ""
987 "может быть: B<no_argument> (или 0), если параметр не требует значения; "
988 "B<required_argument> (или 1), если параметр требует значения; "
989 "B<optional_argument> (или 2), если параметр может иметь необязательное "
990 "значение."
991
992 #. type: TP
993 #: debian-trixie fedora-44 fedora-rawhide
994 #, no-wrap
995 msgid "I<flag>"
996 msgstr "I<flag>"
997
998 #. type: Plain text
999 #: debian-trixie fedora-44 fedora-rawhide
1000 msgid ""
1001 "specifies how results are returned for a long option. If I<flag> is NULL, "
1002 "then B<getopt_long>() returns I<val>. (For example, the calling program "
1003 "may set I<val> to the equivalent short option character.) Otherwise, "
1004 "B<getopt_long>() returns 0, and I<flag> points to a variable which is set "
1005 "to I<val> if the option is found, but left unchanged if the option is not "
1006 "found."
1007 msgstr ""
1008 "способ возвращения результатов для длинного параметра. Если I<flag> равен "
1009 "NULL, то B<getopt_long>() возвращает I<val> (например, вызывающая программа "
1010 "может назначить I<val> эквивалентом символа короткого параметра). В "
1011 "противном случае B<getopt_long>() возвращает 0, а I<flag> указывает на "
1012 "переменную, устанавливаемое значение которой равно I<val>, если параметр "
1013 "найден; и оставляемую без изменений, если параметр не найден."
1014
1015 #. type: TP
1016 #: debian-trixie fedora-44 fedora-rawhide
1017 #, no-wrap
1018 msgid "I<val>"
1019 msgstr "I<val>"
1020
1021 #. type: Plain text
1022 #: debian-trixie fedora-44 fedora-rawhide
1023 msgid ""
1024 "is the value to return, or to load into the variable pointed to by I<flag>."
1025 msgstr ""
1026 "значение, которое возвращается или загружается в переменную, на которую "
1027 "указывает I<flag>."
1028
1029 #. type: Plain text
1030 #: debian-trixie fedora-44 fedora-rawhide
1031 msgid "The last element of the array has to be filled with zeros."
1032 msgstr "Последний элемент массива должен быть заполнен нулями."
1033
1034 #. type: Plain text
1035 #: debian-trixie fedora-44 fedora-rawhide
1036 msgid ""
1037 "If I<longindex> is not NULL, it points to a variable which is set to the "
1038 "index of the long option relative to I<longopts>."
1039 msgstr ""
1040 "Если I<longindex> не равен NULL, то он указывает на переменную, содержащую "
1041 "индекс длинного параметра в соответствии с I<longopts>."
1042
1043 #. type: Plain text
1044 #: debian-trixie fedora-44 fedora-rawhide
1045 #, fuzzy
1046 #| msgid ""
1047 #| "B<getopt_long_only>() is like B<getopt_long>(), but \\(aq-\\(aq as well "
1048 #| "as \"--\" can indicate a long option. If an option that starts with \\"
1049 #| "(aq-\\(aq (not \"--\") doesn't match a long option, but does match a "
1050 #| "short option, it is parsed as a short option instead."
1051 msgid ""
1052 "B<getopt_long_only>() is like B<getopt_long>(), but \\[aq]-\\[aq] as well "
1053 "as \"--\" can indicate a long option. If an option that starts with \\[aq]-"
1054 "\\[aq] (not \"--\") doesn't match a long option, but does match a short "
1055 "option, it is parsed as a short option instead."
1056 msgstr ""
1057 "Функция B<getopt_long_only>() работает так же, как B<getopt_long>(), но в "
1058 "качестве указателя длинного параметра может служить не только «--», но и "
1059 "«-». Если параметр, начинающийся с «-» (не с «--»), не совпадает с длинным "
1060 "параметром, но совпадает с коротким, то он обрабатывается как короткий "
1061 "параметр."
1062
1063 #. type: Plain text
1064 #: debian-trixie fedora-44 fedora-rawhide
1065 #, fuzzy
1066 #| msgid ""
1067 #| "B<getopt_long>() and B<getopt_long_only>() also return the option "
1068 #| "character when a short option is recognized. For a long option, they "
1069 #| "return I<val> if I<flag> is NULL, and 0 otherwise. Error and -1 returns "
1070 #| "are the same as for B<getopt>(), plus \\(aq?\\(aq for an ambiguous match "
1071 #| "or an extraneous parameter."
1072 msgid ""
1073 "B<getopt_long>() and B<getopt_long_only>() also return the option "
1074 "character when a short option is recognized. For a long option, they return "
1075 "I<val> if I<flag> is NULL, and 0 otherwise. Error and -1 returns are the "
1076 "same as for B<getopt>(), plus \\[aq]?\\[aq] for an ambiguous match or an "
1077 "extraneous parameter."
1078 msgstr ""
1079 "Функции B<getopt_long>() и B<getopt_long_only>() также возвращают символ "
1080 "параметра, если распознан короткий параметр. Для длинного параметра они "
1081 "возвращают I<val>, если I<flag> равен NULL, и 0 в противном случае. "
1082 "Возвращаемые ошибки и -1 имеют то же значение, что и для B<getopt>(), кроме "
1083 "того, «?» возвращается при двусмысленном толковании параметра."
1084
1085 #. type: TP
1086 #: debian-trixie fedora-44 fedora-rawhide
1087 #, no-wrap
1088 msgid "B<POSIXLY_CORRECT>"
1089 msgstr "B<POSIXLY_CORRECT>"
1090
1091 #. type: TP
1092 #: debian-trixie
1093 #, no-wrap
1094 msgid "B<_E<lt>PIDE<gt>_GNU_nonoption_argv_flags_>"
1095 msgstr "B<_E<lt>PIDE<gt>_GNU_nonoption_argv_flags_>"
1096
1097 #. type: Plain text
1098 #: debian-trixie
1099 #, fuzzy
1100 #| msgid ""
1101 #| "This variable was used by B<bash>(1) 2.0 to communicate to glibc which "
1102 #| "arguments are the results of wildcard expansion and so should not be "
1103 #| "considered as options. This behavior was removed in B<bash>(1) version "
1104 #| "2.01, but the support remains in glibc."
1105 msgid ""
1106 "This variable was used by B<bash>(1) 2.0 to communicate to glibc which "
1107 "arguments are the results of wildcard expansion and so should not be "
1108 "considered as options. This behavior was removed in B<bash>(1) 2.01, but "
1109 "the support remains in glibc."
1110 msgstr ""
1111 "Эта переменная использовалась B<bash>(1) 2.0 для связи с glibc, аргументы "
1112 "которой являются результатом раскрытия шаблонов и, таким образом, не должны "
1113 "рассматриваться как параметры. Такое поведение было удалено из B<bash>(1) "
1114 "версии 2.01, но поддержка осталась в glibc."
1115
1116 #. type: tbl table
1117 #: debian-trixie fedora-44 fedora-rawhide
1118 #, no-wrap
1119 msgid ""
1120 "B<getopt>(),\n"
1121 "B<getopt_long>(),\n"
1122 "B<getopt_long_only>()"
1123 msgstr ""
1124 "B<getopt>(),\n"
1125 "B<getopt_long>(),\n"
1126 "B<getopt_long_only>()"
1127
1128 #. type: Plain text
1129 #: debian-trixie fedora-44 fedora-rawhide
1130 msgid ""
1131 "POSIX specifies that the I<argv> array argument should be I<const>, but "
1132 "these functions permute its elements unless the environment variable "
1133 "B<POSIXLY_CORRECT> is set. I<const> is used in the actual prototype to be "
1134 "compatible with other systems; however, this page doesn't show the "
1135 "qualifier, to avoid confusing readers."
1136 msgstr ""
1137
1138 #. type: TP
1139 #: debian-trixie fedora-44 fedora-rawhide
1140 #, fuzzy, no-wrap
1141 #| msgid "getopt_long()"
1142 msgid "B<getopt_long>()"
1143 msgstr "getopt_long()"
1144
1145 #. type: TQ
1146 #: debian-trixie fedora-44 fedora-rawhide
1147 #, fuzzy, no-wrap
1148 #| msgid "getopt_long()"
1149 msgid "B<getopt_long_only>()"
1150 msgstr "getopt_long()"
1151
1152 #. type: Plain text
1153 #: debian-trixie fedora-44 fedora-rawhide
1154 msgid "GNU."
1155 msgstr "GNU."
1156
1157 #. type: Plain text
1158 #: debian-trixie fedora-44 fedora-rawhide
1159 #, fuzzy
1160 #| msgid ""
1161 #| "A program that scans multiple argument vectors, or rescans the same "
1162 #| "vector more than once, and wants to make use of GNU extensions such as \\"
1163 #| "(aq+\\(aq and \\(aq-\\(aq at the start of I<optstring>, or changes the "
1164 #| "value of B<POSIXLY_CORRECT> between scans, must reinitialize B<getopt>() "
1165 #| "by resetting I<optind> to 0, rather than the traditional value of 1. "
1166 #| "(Resetting to 0 forces the invocation of an internal initialization "
1167 #| "routine that rechecks B<POSIXLY_CORRECT> and checks for GNU extensions in "
1168 #| "I<optstring>.)"
1169 msgid ""
1170 "A program that scans multiple argument vectors, or rescans the same vector "
1171 "more than once, and wants to make use of GNU extensions such as \\[aq]+\\"
1172 "[aq] and \\[aq]-\\[aq] at the start of I<optstring>, or changes the value of "
1173 "B<POSIXLY_CORRECT> between scans, must reinitialize B<getopt>() by "
1174 "resetting I<optind> to 0, rather than the traditional value of 1. "
1175 "(Resetting to 0 forces the invocation of an internal initialization routine "
1176 "that rechecks B<POSIXLY_CORRECT> and checks for GNU extensions in "
1177 "I<optstring>.)"
1178 msgstr ""
1179 "В программе, где анализируется несколько векторов параметров, или "
1180 "разбирается один вектор более одного раза и нужно использовать расширения "
1181 "GNU «+» и «-» в начале I<optstring> или изменять значение B<POSIXLY_CORRECT> "
1182 "между разборами, должна повторно инициализировать B<getopt>() сбрасывая "
1183 "I<optind> в 0, а не в обычное значение 1 (сброс в 0 вызывает принудительный "
1184 "вызов внутренней процедуры, повторно проверяющей B<POSIXLY_CORRECT> и "
1185 "расширения GNU в I<optstring>)."
1186
1187 #. type: Plain text
1188 #: debian-trixie fedora-44 fedora-rawhide
1189 msgid ""
1190 "The following trivial example program uses B<getopt>() to handle two "
1191 "program options: I<-n>, with no associated value; and I<-t val>, which "
1192 "expects an associated value."
1193 msgstr ""
1194 "В приведённом ниже пример программы B<getopt>() используется два параметра "
1195 "программы: I<-n> без значения и I<-t значение> со значением."
1196
1197 #. SRC END
1198 #. type: SS
1199 #: debian-trixie fedora-44 fedora-rawhide
1200 #, no-wrap
1201 msgid "getopt_long()"
1202 msgstr "getopt_long()"
1203
1204 #. type: Plain text
1205 #: debian-trixie fedora-44 fedora-rawhide
1206 msgid ""
1207 "The following example program illustrates the use of B<getopt_long>() with "
1208 "most of its features."
1209 msgstr ""
1210 "Приведённый ниже пример программы иллюстрирует использование большинства "
1211 "возможностей B<getopt_long>()."
1212
1213 #. type: Plain text
1214 #: debian-trixie fedora-44 fedora-rawhide
1215 #, no-wrap
1216 msgid ""
1217 "#include E<lt>getopt.hE<gt>\n"
1218 "#include E<lt>stdio.hE<gt> /* for printf */\n"
1219 "#include E<lt>stdlib.hE<gt> /* for exit */\n"
1220 "\\&\n"
1221 "int\n"
1222 "main(int argc, char *argv[])\n"
1223 "{\n"
1224 " int c;\n"
1225 " int digit_optind = 0;\n"
1226 "\\&\n"
1227 " while (1) {\n"
1228 " int this_option_optind = optind ? optind : 1;\n"
1229 " int option_index = 0;\n"
1230 " static struct option long_options[] = {\n"
1231 " {\"add\", required_argument, 0, 0 },\n"
1232 " {\"append\", no_argument, 0, 0 },\n"
1233 " {\"delete\", required_argument, 0, 0 },\n"
1234 " {\"verbose\", no_argument, 0, 0 },\n"
1235 " {\"create\", required_argument, 0, \\[aq]c\\[aq]},\n"
1236 " {\"file\", required_argument, 0, 0 },\n"
1237 " {0, 0, 0, 0 }\n"
1238 " };\n"
1239 "\\&\n"
1240 " c = getopt_long(argc, argv, \"abc:d:012\",\n"
1241 " long_options, &option_index);\n"
1242 " if (c == -1)\n"
1243 " break;\n"
1244 "\\&\n"
1245 " switch (c) {\n"
1246 " case 0:\n"
1247 " printf(\"option %s\", long_options[option_index].name);\n"
1248 " if (optarg)\n"
1249 " printf(\" with arg %s\", optarg);\n"
1250 " printf(\"\\[rs]n\");\n"
1251 " break;\n"
1252 "\\&\n"
1253 " case \\[aq]0\\[aq]:\n"
1254 " case \\[aq]1\\[aq]:\n"
1255 " case \\[aq]2\\[aq]:\n"
1256 " if (digit_optind != 0 && digit_optind != this_option_optind)\n"
1257 " printf(\"digits occur in two different argv-elements.\\[rs]n\");\n"
1258 " digit_optind = this_option_optind;\n"
1259 " printf(\"option %c\\[rs]n\", c);\n"
1260 " break;\n"
1261 "\\&\n"
1262 " case \\[aq]a\\[aq]:\n"
1263 " printf(\"option a\\[rs]n\");\n"
1264 " break;\n"
1265 "\\&\n"
1266 " case \\[aq]b\\[aq]:\n"
1267 " printf(\"option b\\[rs]n\");\n"
1268 " break;\n"
1269 "\\&\n"
1270 " case \\[aq]c\\[aq]:\n"
1271 " printf(\"option c with value \\[aq]%s\\[aq]\\[rs]n\", optarg);\n"
1272 " break;\n"
1273 "\\&\n"
1274 " case \\[aq]d\\[aq]:\n"
1275 " printf(\"option d with value \\[aq]%s\\[aq]\\[rs]n\", optarg);\n"
1276 " break;\n"
1277 "\\&\n"
1278 " case \\[aq]?\\[aq]:\n"
1279 " break;\n"
1280 "\\&\n"
1281 " default:\n"
1282 " printf(\"?? getopt returned character code 0%o ??\\[rs]n\", c);\n"
1283 " }\n"
1284 " }\n"
1285 "\\&\n"
1286 " if (optind E<lt> argc) {\n"
1287 " printf(\"non-option ARGV-elements: \");\n"
1288 " while (optind E<lt> argc)\n"
1289 " printf(\"%s \", argv[optind++]);\n"
1290 " printf(\"\\[rs]n\");\n"
1291 " }\n"
1292 "\\&\n"
1293 " exit(EXIT_SUCCESS);\n"
1294 "}\n"
1295 msgstr ""
1296
1297 #. type: Plain text
1298 #: debian-trixie fedora-44 fedora-rawhide
1299 msgid "B<getopt>(1), B<getsubopt>(3)"
1300 msgstr "B<getopt>(1), B<getsubopt>(3)"
1301
1302 #. type: TH
1303 #: fedora-44 fedora-rawhide
1304 #, no-wrap
1305 msgid "2024-12-19"
1306 msgstr "19 декабря 2024 г."
1307
1308 #. type: TH
1309 #: fedora-44 fedora-rawhide
1310 #, no-wrap
1311 msgid "Linux man-pages 6.13"
1312 msgstr "Страницы руководства Linux 6.13"
1313
1314 #. type: Plain text
1315 #: fedora-44 fedora-rawhide
1316 msgid ""
1317 "Very old versions of glibc were affected by a E<.UR https://"
1318 "\\:sourceware.org/\\:git/\\:?"
1319 "p=glibc.git;a=commitdiff;h=bf079e19f50d64aa5e05> "
1320 "B<_>I<PID>B<_GNU_nonoption_argv_flags_> environment variable E<.UE .>"
1321 msgstr ""
1322
1323 #. type: TH
1324 #: mageia-cauldron
1325 #, no-wrap
1326 msgid "Linux man-pages 6.17"
1327 msgstr "Страницы руководства Linux 6.17"
1328
1329 #. type: TH
1330 #: opensuse-leap-16-1 opensuse-tumbleweed
1331 #, no-wrap
1332 msgid "Linux man-pages (unreleased)"
1333 msgstr "Страницы руководства Linux (не выпущены)"