diff options
author | Justin Kunimune <justinkunimune@gmail.com> | 2024-10-10 17:56:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-10 17:56:05 (GMT) |
commit | 3b87fb74c907510402678bf1b7c4a94df0e5e65a (patch) | |
tree | 6ab71b8cb08aa886d8f0bd17f54f73b63a532a02 /Doc/library | |
parent | c9014374c50d6ef64786d3e7d9c7e99053d5c9e2 (diff) | |
download | cpython-3b87fb74c907510402678bf1b7c4a94df0e5e65a.zip cpython-3b87fb74c907510402678bf1b7c4a94df0e5e65a.tar.gz cpython-3b87fb74c907510402678bf1b7c4a94df0e5e65a.tar.bz2 |
Note argparse exit code in documentation (GH-119568)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/argparse.rst | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index e9a0898..4eb6fad 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -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``:: |