]> granicus.if.org Git - python/commitdiff
#10423: clarify options vs args in argparse discussion of optparse
authorR David Murray <rdmurray@bitdance.com>
Fri, 30 Mar 2012 22:07:42 +0000 (18:07 -0400)
committerR David Murray <rdmurray@bitdance.com>
Fri, 30 Mar 2012 22:07:42 +0000 (18:07 -0400)
Patch by Sandro Tosi.

Doc/library/argparse.rst

index b84e5c8a72a81d9fbc52ab4d0d1d333fb0a744b1..0123b5cbac9aa3ecc94665616ae399ca1226be38 100644 (file)
@@ -1833,9 +1833,10 @@ A partial upgrade path from :mod:`optparse` to :mod:`argparse`:
 * Replace all :meth:`optparse.OptionParser.add_option` calls with
   :meth:`ArgumentParser.add_argument` calls.
 
-* Replace ``options, args = parser.parse_args()`` with ``args =
+* Replace ``(options, args) = parser.parse_args()`` with ``args =
   parser.parse_args()`` and add additional :meth:`ArgumentParser.add_argument`
-  calls for the positional arguments.
+  calls for the positional arguments. Keep in mind that what was previously
+  called ``options``, now in :mod:`argparse` context is called ``args``.
 
 * Replace callback actions and the ``callback_*`` keyword arguments with
   ``type`` or ``action`` arguments.