summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-09-17 16:26:06 (GMT)
committerGeorg Brandl <georg@python.org>2009-09-17 16:26:06 (GMT)
commit7842a41f5cb700531ae5da8acc2fa88c3eaf8b36 (patch)
tree66e141c77abf939847d178ed9c43008d2805df19 /Doc
parent304d3966eec4ad0266eb48c6a0b2c758004c431d (diff)
downloadcpython-7842a41f5cb700531ae5da8acc2fa88c3eaf8b36.zip
cpython-7842a41f5cb700531ae5da8acc2fa88c3eaf8b36.tar.gz
cpython-7842a41f5cb700531ae5da8acc2fa88c3eaf8b36.tar.bz2
Remove duplicate doc of enable/disable_interspersed_args.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/optparse.rst46
1 files changed, 19 insertions, 27 deletions
diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst
index a28d6dd..4a6fa39 100644
--- a/Doc/library/optparse.rst
+++ b/Doc/library/optparse.rst
@@ -1207,18 +1207,27 @@ and you can also poke around your option parser and see what's there.
OptionParser provides several methods to help you out:
``disable_interspersed_args()``
- Set parsing to stop on the first non-option. Use this if you have a
- command processor which runs another command which has options of
- its own and you want to make sure these options don't get
- confused. For example, each command might have a different
- set of options.
+ Set parsing to stop on the first non-option. For example, if ``"-a"`` and
+ ``"-b"`` are both simple options that take no arguments, :mod:`optparse`
+ normally accepts this syntax::
+
+ prog -a arg1 -b arg2
+
+ and treats it as equivalent to ::
+
+ prog -a -b arg1 arg2
+
+ To disable this feature, call ``disable_interspersed_args()``. This restores
+ traditional Unix syntax, where option parsing stops with the first non-option
+ argument.
+
+ Use this if you have a command processor which runs another command which has
+ options of its own and you want to make sure these options don't get confused.
+ For example, each command might have a different set of options.
``enable_interspersed_args()``
- Set parsing to not stop on the first non-option, allowing
- interspersing switches with command arguments. For example,
- ``"-s arg1 --long arg2"`` would return ``["arg1", "arg2"]``
- as the command arguments and ``-s, --long`` as options.
- This is the default behavior.
+ Set parsing to not stop on the first non-option, allowing interspersing
+ switches with command arguments. This is the default behavior.
``get_option(opt_str)``
Returns the Option instance with the option string ``opt_str``, or ``None`` if
@@ -1329,23 +1338,6 @@ OptionParser supports several other public methods:
constructor keyword argument. Passing ``None`` sets the default usage string;
use ``SUPPRESS_USAGE`` to suppress a usage message.
-* ``enable_interspersed_args()``, ``disable_interspersed_args()``
-
- Enable/disable positional arguments interspersed with options, similar to GNU
- getopt (enabled by default). For example, if ``"-a"`` and ``"-b"`` are both
- simple options that take no arguments, :mod:`optparse` normally accepts this
- syntax::
-
- prog -a arg1 -b arg2
-
- and treats it as equivalent to ::
-
- prog -a -b arg1 arg2
-
- To disable this feature, call ``disable_interspersed_args()``. This restores
- traditional Unix syntax, where option parsing stops with the first non-option
- argument.
-
* ``set_defaults(dest=value, ...)``
Set default values for several option destinations at once. Using