@@ -1915,12 +1915,14 @@ msgid ""
19151915" if given, it prints a *message* before that. The user can override this "
19161916"method to handle these steps differently::"
19171917msgstr ""
1918+ "此方法将终结程序,退出时附带指定的 *status*,并且如果给出了 *message* 则会在退出前将其打印输出。 "
1919+ "用户可重载此方法以不同方式来处理这些步骤::"
19181920
19191921#: ../../library/argparse.rst:2050
19201922msgid ""
19211923"This method prints a usage message including the *message* to the standard "
19221924"error and terminates the program with a status code of 2."
1923- msgstr ""
1925+ msgstr "此方法将向标准错误打印包括 *message* 的用法消息并附带状态码 2 终结程序。 "
19241926
19251927#: ../../library/argparse.rst:2055
19261928msgid "Intermixed parsing"
@@ -1933,6 +1935,8 @@ msgid ""
19331935"and :meth:`~ArgumentParser.parse_known_intermixed_args` methods support this"
19341936" parsing style."
19351937msgstr ""
1938+ "许多 Unix 命令允许用户混用可选参数与位置参数。 :meth:`~ArgumentParser.parse_intermixed_args` 和 "
1939+ ":meth:`~ArgumentParser.parse_known_intermixed_args` 方法均支持这种解析风格。"
19361940
19371941#: ../../library/argparse.rst:2065
19381942msgid ""
@@ -1941,6 +1945,8 @@ msgid ""
19411945"``argparse.REMAINDER``, and mutually exclusive groups that include both "
19421946"optionals and positionals are not supported."
19431947msgstr ""
1948+ "这些解析器并不支持所有的 argparse 特性,并且当未支持的特性被使用时将会引发异常。 "
1949+ "特别地,子解析器,``argparse.REMAINDER`` 以及同时包括可选与位置参数的互斥分组是不受支持的。"
19441950
19451951#: ../../library/argparse.rst:2070
19461952msgid ""
@@ -1950,6 +1956,9 @@ msgid ""
19501956"'3']`` as unparsed arguments, while the latter collects all the positionals "
19511957"into ``rest``. ::"
19521958msgstr ""
1959+ "下面的例子显示了 :meth:`~ArgumentParser.parse_known_args` 与 "
1960+ ":meth:`~ArgumentParser.parse_intermixed_args` 之间的差异:前者会将 ``['2', '3']`` "
1961+ "返回为未解析的参数,而后者会将所有位置参数收集至 ``rest`` 中。 ::"
19531962
19541963#: ../../library/argparse.rst:2085
19551964msgid ""
@@ -1958,6 +1967,9 @@ msgid ""
19581967"strings. :meth:`~ArgumentParser.parse_intermixed_args` raises an error if "
19591968"there are any remaining unparsed argument strings."
19601969msgstr ""
1970+ ":meth:`~ArgumentParser.parse_known_intermixed_args` "
1971+ "返回由两个条目组成的元组,其中包含带成员的命名空间以及剩余参数字符串列表。 当存在任何剩余的未解析参数字符串时 "
1972+ ":meth:`~ArgumentParser.parse_intermixed_args` 将引发一个错误。"
19611973
19621974#: ../../library/argparse.rst:2095
19631975msgid "Upgrading optparse code"
0 commit comments