summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-10-17 10:28:04 (GMT)
committerGeorg Brandl <georg@python.org>2010-10-17 10:28:04 (GMT)
commit9375492be3244ef771b784778b6e44d115aab229 (patch)
tree3530d33dc14592b7e12dbabc31342cbc97ba19fe
parent0036bcf8d8c7baf3c27c50d9e03e450ff93585db (diff)
downloadcpython-9375492be3244ef771b784778b6e44d115aab229.zip
cpython-9375492be3244ef771b784778b6e44d115aab229.tar.gz
cpython-9375492be3244ef771b784778b6e44d115aab229.tar.bz2
#9112: document error() and exit() methods of ArgumentParser.
-rw-r--r--Doc/library/argparse.rst15
1 files changed, 14 insertions, 1 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index f50492a..c2d7e73 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -1663,7 +1663,6 @@ printing it:
information about the arguments registered with the :class:`ArgumentParser`.
-
Partial parsing
^^^^^^^^^^^^^^^
@@ -1709,6 +1708,20 @@ Customizing file parsing
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
-----------------------