diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2008-11-14 00:11:12 +0000 |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2008-11-14 00:11:12 +0000 |
commit | 8b2b75692a7f18ecaf123aa429096c1c9b439b15 (patch) | |
tree | f6eb5ccb1f5ed93e287a621a1d911350d4e6fbd6 | |
parent | 007ee17e21eeb3dcbb515efa1436f3f669aad2fc (diff) | |
download | cpython-git-8b2b75692a7f18ecaf123aa429096c1c9b439b15.tar.gz |
Backport r66804: #1415508 from Rocky Bernstein: add docstrings for enable_interspersed_args(), disable_interspersed_args()
-rw-r--r-- | Lib/optparse.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/optparse.py b/Lib/optparse.py index 5aa3b967b0..d41ad3d61e 100644 --- a/Lib/optparse.py +++ b/Lib/optparse.py @@ -1281,9 +1281,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): |