@@ -1876,12 +1876,14 @@ msgid ""
18761876" if given, it prints a *message* before that. The user can override this "
18771877"method to handle these steps differently::"
18781878msgstr ""
1879+ "此方法将终结程序,退出时附带指定的 *status*,并且如果给出了 *message* 则会在退出前将其打印输出。 "
1880+ "用户可重载此方法以不同方式来处理这些步骤::"
18791881
18801882#: ../../library/argparse.rst:2022
18811883msgid ""
18821884"This method prints a usage message including the *message* to the standard "
18831885"error and terminates the program with a status code of 2."
1884- msgstr ""
1886+ msgstr "此方法将向标准错误打印包括 *message* 的用法消息并附带状态码 2 终结程序。 "
18851887
18861888#: ../../library/argparse.rst:2027
18871889msgid "Intermixed parsing"
@@ -1894,6 +1896,8 @@ msgid ""
18941896"and :meth:`~ArgumentParser.parse_known_intermixed_args` methods support this"
18951897" parsing style."
18961898msgstr ""
1899+ "许多 Unix 命令允许用户混用可选参数与位置参数。 :meth:`~ArgumentParser.parse_intermixed_args` 和 "
1900+ ":meth:`~ArgumentParser.parse_known_intermixed_args` 方法均支持这种解析风格。"
18971901
18981902#: ../../library/argparse.rst:2037
18991903msgid ""
@@ -1902,6 +1906,8 @@ msgid ""
19021906"``argparse.REMAINDER``, and mutually exclusive groups that include both "
19031907"optionals and positionals are not supported."
19041908msgstr ""
1909+ "这些解析器并不支持所有的 argparse 特性,并且当未支持的特性被使用时将会引发异常。 "
1910+ "特别地,子解析器,``argparse.REMAINDER`` 以及同时包括可选与位置参数的互斥分组是不受支持的。"
19051911
19061912#: ../../library/argparse.rst:2042
19071913msgid ""
@@ -1911,6 +1917,9 @@ msgid ""
19111917"'3']`` as unparsed arguments, while the latter collects all the positionals "
19121918"into ``rest``. ::"
19131919msgstr ""
1920+ "下面的例子显示了 :meth:`~ArgumentParser.parse_known_args` 与 "
1921+ ":meth:`~ArgumentParser.parse_intermixed_args` 之间的差异:前者会将 ``['2', '3']`` "
1922+ "返回为未解析的参数,而后者会将所有位置参数收集至 ``rest`` 中。 ::"
19141923
19151924#: ../../library/argparse.rst:2057
19161925msgid ""
@@ -1919,6 +1928,9 @@ msgid ""
19191928"strings. :meth:`~ArgumentParser.parse_intermixed_args` raises an error if "
19201929"there are any remaining unparsed argument strings."
19211930msgstr ""
1931+ ":meth:`~ArgumentParser.parse_known_intermixed_args` "
1932+ "返回由两个条目组成的元组,其中包含带成员的命名空间以及剩余参数字符串列表。 当存在任何剩余的未解析参数字符串时 "
1933+ ":meth:`~ArgumentParser.parse_intermixed_args` 将引发一个错误。"
19221934
19231935#: ../../library/argparse.rst:2067
19241936msgid "Upgrading optparse code"
0 commit comments