diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2014-09-26 12:35:02 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2014-09-26 12:35:02 (GMT) |
commit | 4f6355f8618bd463abe9dfe647ba60dcf2d71546 (patch) | |
tree | 67741a05377a868fbb3c7a93e59cb9db9d93f742 /Doc/library/argparse.rst | |
parent | 1f3d0fd7afa8aa793ddf4e18b7bf9c7b9a4ffce0 (diff) | |
parent | 6c1f0ad66545c67ace54155a021de1cd4b1dae8f (diff) | |
download | cpython-4f6355f8618bd463abe9dfe647ba60dcf2d71546.zip cpython-4f6355f8618bd463abe9dfe647ba60dcf2d71546.tar.gz cpython-4f6355f8618bd463abe9dfe647ba60dcf2d71546.tar.bz2 |
Issue #17462: Add a paragraph about advantages of argparse over optparse.
Patch by Anastasia Filatova.
Diffstat (limited to 'Doc/library/argparse.rst')
-rw-r--r-- | Doc/library/argparse.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 62948e2..4f2febe 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1949,6 +1949,16 @@ transparently, particularly with the changes required to support the new :mod:`optparse` had either been copy-pasted over or monkey-patched, it no longer seemed practical to try to maintain the backwards compatibility. +The :mod:`argparse` module improves on the standard library :mod:`optparse` +module in a number of ways including: + +* Handling positional arguments. +* Supporting sub-commands. +* Allowing alternative option prefixes like ``+`` and ``/``. +* Handling zero-or-more and one-or-more style arguments. +* Producing more informative usage messages. +* Providing a much simpler interface for custom ``type`` and ``action``. + A partial upgrade path from :mod:`optparse` to :mod:`argparse`: * Replace all :meth:`optparse.OptionParser.add_option` calls with |