mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Note argparse exit code in documentation (GH-119568)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
This commit is contained in:
parent
c9014374c5
commit
3b87fb74c9
1 changed files with 2 additions and 1 deletions
|
@ -541,7 +541,8 @@ exit_on_error
|
|||
^^^^^^^^^^^^^
|
||||
|
||||
Normally, when you pass an invalid argument list to the :meth:`~ArgumentParser.parse_args`
|
||||
method of an :class:`ArgumentParser`, it will exit with error info.
|
||||
method of an :class:`ArgumentParser`, it will print a *message* to :data:`sys.stderr` and exit with a status
|
||||
code of 2.
|
||||
|
||||
If the user would like to catch errors manually, the feature can be enabled by setting
|
||||
``exit_on_error`` to ``False``::
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue