mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
#9112: document error() and exit() methods of ArgumentParser.
This commit is contained in:
parent
0036bcf8d8
commit
9375492be3
1 changed files with 14 additions and 1 deletions
|
|
@ -1663,7 +1663,6 @@ printing it:
|
||||||
information about the arguments registered with the :class:`ArgumentParser`.
|
information about the arguments registered with the :class:`ArgumentParser`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Partial parsing
|
Partial parsing
|
||||||
^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
|
@ -1709,6 +1708,20 @@ Customizing file parsing
|
||||||
yield arg
|
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
|
Upgrading optparse code
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue