From: Andrew M. Kuchling Date: Sun, 5 Oct 2008 00:11:56 +0000 (+0000) Subject: #1415508 from Rocky Bernstein: add docstrings for enable_interspersed_args(), disable... X-Git-Tag: v2.7a1~2769 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcf3b1c79a95cd3d29cae6a99fcc8f752ee9281a;p=thirdparty%2FPython%2Fcpython.git #1415508 from Rocky Bernstein: add docstrings for enable_interspersed_args(), disable_interspersed_args() --- diff --git a/Lib/optparse.py b/Lib/optparse.py index 2cb21de97f43..e38030d463af 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):