mirror of
https://github.com/python/cpython.git
synced 2025-07-31 23:23:11 +00:00
#1415508 from Rocky Bernstein: add docstrings for enable_interspersed_args(), disable_interspersed_args()
This commit is contained in:
parent
f9db5968cc
commit
dcf3b1c79a
1 changed files with 10 additions and 0 deletions
|
@ -1274,9 +1274,19 @@ class OptionParser (OptionContainer):
|
||||||
self.usage = usage
|
self.usage = usage
|
||||||
|
|
||||||
def enable_interspersed_args(self):
|
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
|
self.allow_interspersed_args = True
|
||||||
|
|
||||||
def disable_interspersed_args(self):
|
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
|
self.allow_interspersed_args = False
|
||||||
|
|
||||||
def set_process_default_values(self, process):
|
def set_process_default_values(self, process):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue