@@ -733,43 +733,49 @@ msgid ""
733
733
"line, or if you just call :meth:`parser.print_help`, it prints the following"
734
734
" to standard output:"
735
735
msgstr ""
736
+ "如果 :mod:`optparse` 在命令行中遇到了 ``-h`` 或 ``--help``,或者如果你调用了 "
737
+ ":meth:`parser.print_help`,它会把以下内容打印到标准输出:"
736
738
737
739
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:510
738
740
msgid ""
739
741
"(If the help output is triggered by a help option, :mod:`optparse` exits "
740
742
"after printing the help text.)"
741
- msgstr ""
743
+ msgstr "(如果帮助输出是由 help 选项触发的,:mod:`optparse` 将在打印帮助文本之后退出。) "
742
744
743
745
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:513
744
746
msgid ""
745
747
"There's a lot going on here to help :mod:`optparse` generate the best "
746
748
"possible help message:"
747
- msgstr ""
749
+ msgstr "在这里为帮助 :mod:`optparse` 生成尽可能好的帮助消息做了很多工作: "
748
750
749
751
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:516
750
752
msgid "the script defines its own usage message::"
751
- msgstr ""
753
+ msgstr "该脚本定义了自己的用法消息:: "
752
754
753
755
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:520
754
756
msgid ""
755
757
":mod:`optparse` expands ``%prog`` in the usage string to the name of the "
756
758
"current program, i.e. ``os.path.basename(sys.argv[0])``. The expanded "
757
759
"string is then printed before the detailed option help."
758
760
msgstr ""
761
+ ":mod:`optparse` 会将用法字符串中的 ``%prog`` 扩展为当前程序的名称,即 "
762
+ "``os.path.basename(sys.argv[0])``。 随后将在详细选项帮助之前打印这个经过扩展的字符串。"
759
763
760
764
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:524
761
765
msgid ""
762
766
"If you don't supply a usage string, :mod:`optparse` uses a bland but "
763
767
"sensible default: ``\" Usage: %prog [options]\" ``, which is fine if your "
764
768
"script doesn't take any positional arguments."
765
769
msgstr ""
770
+ "如果你未提供用法字符串,:mod:`optparse` 将使用一个直白而合理的默认值: ``\" Usage: %prog "
771
+ "[options]\" ``,这在你的脚本不接受任何位置参数时是可以的。"
766
772
767
773
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:528
768
774
msgid ""
769
775
"every option defines a help string, and doesn't worry about line-"
770
776
"wrapping---\\ :mod:`optparse` takes care of wrapping lines and making the "
771
777
"help output look good."
772
- msgstr ""
778
+ msgstr "每个选项都定义了帮助字符串,并且不用担心换行问题 --- :mod:`optparse` 将负责执行换行并使帮助输出有良好的外观格式。 "
773
779
774
780
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:532
775
781
msgid ""
@@ -796,6 +802,8 @@ msgid ""
796
802
" effective way to make your help text a lot clearer and more useful for end "
797
803
"users."
798
804
msgstr ""
805
+ "不过,这具有比节省一点空间更重要的作用:手动编写的帮助文本使用元变量 ``FILE`` 来提示用户在半正式的语法 ``-f FILE`` 和非正式的描述"
806
+ " \" write output to FILE\" 之间存在联系。 这是一种使你的帮助文本更清晰并对最终用户来说更易用的简单而有效的方式。"
799
807
800
808
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:552
801
809
msgid ""
@@ -804,17 +812,21 @@ msgid ""
804
812
" default value. If an option has no default value (or the default value is "
805
813
"``None``), ``%default`` expands to ``none``."
806
814
msgstr ""
815
+ "具有默认值的选项可以在帮助字符串中包括 ``%default`` --- :mod:`optparse` 将用该选项的默认值的 :func:`str` "
816
+ "来替代它。 如果一个选项没有默认值 (或默认值为 ``None``),则 ``%default`` 将被扩展为 ``none``。"
807
817
808
818
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:558
809
819
msgid "Grouping Options"
810
- msgstr ""
820
+ msgstr "选项分组 "
811
821
812
822
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:560
813
823
msgid ""
814
824
"When dealing with many options, it is convenient to group these options for "
815
825
"better help output. An :class:`OptionParser` can contain several option "
816
826
"groups, each of which can contain several options."
817
827
msgstr ""
828
+ "在处理大量选项时,可以方便地将选项进行分组以提供更好的帮助输出。 :class:`OptionParser` "
829
+ "可以包含多个选项分组,每个分组可以包含多个选项。"
818
830
819
831
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:564
820
832
msgid "An option group is obtained using the class :class:`OptionGroup`:"
0 commit comments