Merged revisions 81490 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81490 | steven.bethard | 2010-05-23 19:38:00 -0700 (Sun, 23 May 2010) | 1 line
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 89ab63a..19c5c81 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>')``