[Python-checkins] r85622 - python/branches/py3k/Doc/library/argparse.rst

georg.brandl python-checkins at python.org
Sun Oct 17 12:28:04 CEST 2010


Author: georg.brandl
Date: Sun Oct 17 12:28:04 2010
New Revision: 85622

Log:
#9112: document error() and exit() methods of ArgumentParser.

Modified:
   python/branches/py3k/Doc/library/argparse.rst

Modified: python/branches/py3k/Doc/library/argparse.rst
==============================================================================
--- python/branches/py3k/Doc/library/argparse.rst	(original)
+++ python/branches/py3k/Doc/library/argparse.rst	Sun Oct 17 12:28:04 2010
@@ -1663,7 +1663,6 @@
    information about the arguments registered with the :class:`ArgumentParser`.
 
 
-
 Partial parsing
 ^^^^^^^^^^^^^^^
 
@@ -1709,6 +1708,20 @@
             yield arg
 
 
+Exiting methods
+^^^^^^^^^^^^^^^
+
+.. method:: ArgumentParser.exit(status=0, message=None)
+
+   This method terminates the program, exiting with the specified *status*
+   and, if given, it prints a *message* before that.
+
+.. method:: ArgumentParser.error(message)
+
+   This method prints a usage message including the *message* to the
+   standard output and terminates the program with a status code of 2.
+
+
 Upgrading optparse code
 -----------------------
 


More information about the Python-checkins mailing list