summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2008-10-05 00:11:56 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2008-10-05 00:11:56 (GMT)
commitdcf3b1c79a95cd3d29cae6a99fcc8f752ee9281a (patch)
tree7222ab3c134739e1ed5a826985fb1c7c6059ab9e
parentf9db5968cc50df6ce13045715011961e1d177d87 (diff)
downloadcpython-dcf3b1c79a95cd3d29cae6a99fcc8f752ee9281a.zip
cpython-dcf3b1c79a95cd3d29cae6a99fcc8f752ee9281a.tar.gz
cpython-dcf3b1c79a95cd3d29cae6a99fcc8f752ee9281a.tar.bz2
#1415508 from Rocky Bernstein: add docstrings for enable_interspersed_args(), disable_interspersed_args()
-rw-r--r--Lib/optparse.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/optparse.py b/Lib/optparse.py
index 2cb21de..e38030d 100644
--- a/Lib/optparse.py
+++ b/Lib/optparse.py
@@ -1274,9 +1274,19 @@ class OptionParser (OptionContainer):
self.usage = usage
def enable_interspersed_args(self):
+ """Set parsing to not stop on the first non-option, allowing
+ interspersing switches with command arguments. This is the
+ default behavior. See also disable_interspersed_args() and the
+ class documentation description of the attribute
+ allow_interspersed_args."""
self.allow_interspersed_args = True
def disable_interspersed_args(self):
+ """Set parsing to stop on the first non-option. Use this if
+ you have a command processor which runs another command that
+ has options of its own and you want to make sure these options
+ don't get confused.
+ """
self.allow_interspersed_args = False
def set_process_default_values(self, process):