argparse documentation updates (including updates to optparse and getopt documentation that were promised in the PEP)
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index 4f154c4..7a56554 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -672,8 +672,8 @@
>>> import argparse
>>> parser = argparse.ArgumentParser(prog='PROG')
- >>> parser.add_argument('-v', '--version', action='version', version='%(prog)s 2.0')
- >>> parser.parse_args(['-v'])
+ >>> parser.add_argument('--version', action='version', version='%(prog)s 2.0')
+ >>> parser.parse_args(['--version'])
PROG 2.0
You can also specify an arbitrary action by passing an object that implements
@@ -1725,3 +1725,6 @@
* Replace strings with implicit arguments such as ``%default`` or ``%prog`` with
the standard python syntax to use dictionaries to format strings, that is,
``%(default)s`` and ``%(prog)s``.
+
+* Replace the OptionParser constructor ``version`` argument with a call to
+ ``parser.add_argument('--version', action='version', version='<the version>')``