@@ -119,13 +119,17 @@ msgid ""
119119"intermixed. The :func:`getopt` function stops processing options as soon as "
120120"a non-option argument is encountered."
121121msgstr ""
122+ "此函数与 :func:`getopt` 类似,区别在于它默认使用 GNU 风格的扫描模式。 这意味着选项和非选项参数可能会混在一起。 "
123+ ":func:`getopt` 函数将在遇到非选项参数时立即停止处理选项。"
122124
123125#: ../../library/getopt.rst:73
124126msgid ""
125127"If the first character of the option string is ``'+'``, or if the "
126128"environment variable :envvar:`POSIXLY_CORRECT` is set, then option "
127129"processing stops as soon as a non-option argument is encountered."
128130msgstr ""
131+ "如果选项字符串的第一个字符为 ``'+'``,或者如果设置了环境变量 "
132+ ":envvar:`POSIXLY_CORRECT`,则选项处理会在遇到非选项参数时立即停止。"
129133
130134#: ../../library/getopt.rst:80
131135msgid ""
@@ -137,34 +141,37 @@ msgid ""
137141"give the error message and related option; if there is no specific option to"
138142" which the exception relates, :attr:`opt` is an empty string."
139143msgstr ""
144+ "This is raised当参数列表中出现不可识别的选项或者当一个需要参数的选项未带参数时将引发此异常。 此异常的参数是一个指明错误原因的字符串。 "
145+ "对于长选项,将一个参数传给不需要参数的选项也将导致引发此异常。 :attr:`msg` 和 :attr:`opt` "
146+ "属性会给出错误消息和关联的选项;如果没有关联到异常的特定选项,则 :attr:`opt` 将为空字符串。"
140147
141148#: ../../library/getopt.rst:91
142149msgid "Alias for :exc:`GetoptError`; for backward compatibility."
143- msgstr ""
150+ msgstr ":exc:`GetoptError` 的别名;用于向后兼容。 "
144151
145152#: ../../library/getopt.rst:93
146153msgid "An example using only Unix style options:"
147- msgstr ""
154+ msgstr "一个仅使用 Unix 风格选项的例子: "
148155
149156#: ../../library/getopt.rst:105
150157msgid "Using long option names is equally easy:"
151- msgstr ""
158+ msgstr "使用长选项名也同样容易: "
152159
153160#: ../../library/getopt.rst:118
154161msgid "In a script, typical usage is something like this::"
155- msgstr ""
162+ msgstr "在脚本中,典型的用法类似这样:: "
156163
157164#: ../../library/getopt.rst:147
158165msgid ""
159166"Note that an equivalent command line interface could be produced with less "
160167"code and more informative help and error messages by using the "
161168":mod:`argparse` module::"
162- msgstr ""
169+ msgstr "请注意通过 :mod:`argparse` 模块可以使用更少的代码并附带更详细的帮助与错误消息生成等价的命令行接口:: "
163170
164171#: ../../library/getopt.rst:162
165172msgid "Module :mod:`argparse`"
166- msgstr ""
173+ msgstr "模块 :mod:`argparse` "
167174
168175#: ../../library/getopt.rst:163
169176msgid "Alternative command line option and argument parsing library."
170- msgstr ""
177+ msgstr "替代的命令行选项和参数解析库。 "
0 commit comments