diff options
author | R David Murray <rdmurray@bitdance.com> | 2012-03-30 22:08:29 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2012-03-30 22:08:29 (GMT) |
commit | 3288e948f3fd6c553576ab92706dfd3b5f66f2fb (patch) | |
tree | 7e4e69264b7f640c7ed312a75abb2bcf4ae7977d /Doc/library/argparse.rst | |
parent | 1ff50df8bc4048f72bc770372968da2f262cb58e (diff) | |
parent | 5e0c57142d7380d7209f198f772bb9851739652d (diff) | |
download | cpython-3288e948f3fd6c553576ab92706dfd3b5f66f2fb.zip cpython-3288e948f3fd6c553576ab92706dfd3b5f66f2fb.tar.gz cpython-3288e948f3fd6c553576ab92706dfd3b5f66f2fb.tar.bz2 |
Merge #10423: clarify options vs args in argparse discussion of optparse
Patch by Sandro Tosi.
Diffstat (limited to 'Doc/library/argparse.rst')
-rw-r--r-- | Doc/library/argparse.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 9a125d3..50ccb31 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1852,9 +1852,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. |