Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit de2cef5

Browse files
committed
Merged revisions 77269 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ................ r77269 | ezio.melotti | 2010-01-03 11:06:02 +0200 (Sun, 03 Jan 2010) | 9 lines Merged revisions 77267 via svnmerge from svn+ssh://[email protected]/python/trunk ........ r77267 | ezio.melotti | 2010-01-03 11:01:27 +0200 (Sun, 03 Jan 2010) | 1 line #7618: fix highlight of code blocks ........ ................
1 parent 1d566cb commit de2cef5

1 file changed

Lines changed: 19 additions & 7 deletions

File tree

Doc/library/optparse.rst

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ Additionally, users can run one of ::
5151
<yourscript> -h
5252
<yourscript> --help
5353

54-
and :mod:`optparse` will print out a brief summary of your script's options::
54+
and :mod:`optparse` will print out a brief summary of your script's options:
55+
56+
.. code-block:: text
5557
5658
usage: <yourscript> [options]
5759
@@ -126,12 +128,16 @@ option argument
126128
an argument that follows an option, is closely associated with that option,
127129
and is consumed from the argument list when that option is. With
128130
:mod:`optparse`, option arguments may either be in a separate argument from
129-
their option::
131+
their option:
132+
133+
.. code-block:: text
130134
131135
-f foo
132136
--file foo
133137
134-
or included in the same argument::
138+
or included in the same argument:
139+
140+
.. code-block:: text
135141
136142
-ffoo
137143
--file=foo
@@ -476,7 +482,9 @@ user-friendly (documented) options::
476482

477483
If :mod:`optparse` encounters either ``"-h"`` or ``"--help"`` on the
478484
command-line, or if you just call :meth:`parser.print_help`, it prints the
479-
following to standard output::
485+
following to standard output:
486+
487+
.. code-block:: text
480488
481489
usage: <yourscript> [options] arg1 arg2
482490
@@ -549,7 +557,9 @@ parser is easy::
549557
group.add_option("-g", action="store_true", help="Group option.")
550558
parser.add_option_group(group)
551559

552-
This would result in the following help output::
560+
This would result in the following help output:
561+
562+
.. code-block:: text
553563
554564
usage: [options] arg1 arg2
555565
@@ -1126,7 +1136,9 @@ must specify for any option using that action.
11261136

11271137
If :mod:`optparse` sees either ``"-h"`` or ``"--help"`` on the command line,
11281138
it will print something like the following help message to stdout (assuming
1129-
``sys.argv[0]`` is ``"foo.py"``)::
1139+
``sys.argv[0]`` is ``"foo.py"``):
1140+
1141+
.. code-block:: text
11301142
11311143
usage: foo.py [options]
11321144
@@ -1848,7 +1860,7 @@ would result in a list ::
18481860

18491861
Again we define a subclass of Option::
18501862

1851-
class MyOption (Option):
1863+
class MyOption(Option):
18521864

18531865
ACTIONS = Option.ACTIONS + ("extend",)
18541866
STORE_ACTIONS = Option.STORE_ACTIONS + ("extend",)

0 commit comments

Comments
 (0)