[Python-checkins] r77268 - in python/branches/release26-maint: Doc/library/optparse.rst
ezio.melotti
python-checkins at python.org
Sun Jan 3 10:04:20 CET 2010
Author: ezio.melotti
Date: Sun Jan 3 10:04:19 2010
New Revision: 77268
Log:
Merged revisions 77267 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77267 | ezio.melotti | 2010-01-03 11:01:27 +0200 (Sun, 03 Jan 2010) | 1 line
#7618: fix highlight of code blocks
........
Modified:
python/branches/release26-maint/ (props changed)
python/branches/release26-maint/Doc/library/optparse.rst
Modified: python/branches/release26-maint/Doc/library/optparse.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/optparse.rst (original)
+++ python/branches/release26-maint/Doc/library/optparse.rst Sun Jan 3 10:04:19 2010
@@ -55,7 +55,9 @@
<yourscript> -h
<yourscript> --help
-and :mod:`optparse` will print out a brief summary of your script's options::
+and :mod:`optparse` will print out a brief summary of your script's options:
+
+.. code-block:: text
usage: <yourscript> [options]
@@ -130,12 +132,16 @@
an argument that follows an option, is closely associated with that option,
and is consumed from the argument list when that option is. With
:mod:`optparse`, option arguments may either be in a separate argument from
- their option::
+ their option:
+
+ .. code-block:: text
-f foo
--file foo
- or included in the same argument::
+ or included in the same argument:
+
+ .. code-block:: text
-ffoo
--file=foo
@@ -482,7 +488,9 @@
If :mod:`optparse` encounters either ``"-h"`` or ``"--help"`` on the
command-line, or if you just call :meth:`parser.print_help`, it prints the
-following to standard output::
+following to standard output:
+
+.. code-block:: text
usage: <yourscript> [options] arg1 arg2
@@ -556,7 +564,9 @@
group.add_option("-g", action="store_true", help="Group option.")
parser.add_option_group(group)
-This would result in the following help output::
+This would result in the following help output:
+
+.. code-block:: text
usage: [options] arg1 arg2
@@ -1133,7 +1143,9 @@
If :mod:`optparse` sees either ``"-h"`` or ``"--help"`` on the command line,
it will print something like the following help message to stdout (assuming
- ``sys.argv[0]`` is ``"foo.py"``)::
+ ``sys.argv[0]`` is ``"foo.py"``):
+
+ .. code-block:: text
usage: foo.py [options]
@@ -1855,7 +1867,7 @@
Again we define a subclass of Option::
- class MyOption (Option):
+ class MyOption(Option):
ACTIONS = Option.ACTIONS + ("extend",)
STORE_ACTIONS = Option.STORE_ACTIONS + ("extend",)
More information about the Python-checkins
mailing list