Skip to content

Commit c9b40f5

Browse files
Add to docs
1 parent f516bb4 commit c9b40f5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Doc/library/argparse.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ ArgumentParser objects
189189
formatter_class=argparse.HelpFormatter, \
190190
prefix_chars='-', fromfile_prefix_chars=None, \
191191
argument_default=None, conflict_handler='error', \
192-
add_help=True, allow_abbrev=True, exit_on_error=True)
192+
add_help=True, allow_abbrev=True, exit_on_error=True,\
193+
suggest_on_error=False)
193194

194195
Create a new :class:`ArgumentParser` object. All parameters should be passed
195196
as keyword arguments. Each parameter has its own more detailed description
@@ -230,6 +231,10 @@ ArgumentParser objects
230231

231232
* exit_on_error_ - Determines whether or not ArgumentParser exits with
232233
error info when an error occurs. (default: ``True``)
234+
235+
* suggest_on_error_ - Enables suggestions for mistyped argument choices
236+
and subparser names. (default: ``False``)
237+
233238

234239
.. versionchanged:: 3.5
235240
*allow_abbrev* parameter was added.

Lib/argparse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,8 +1715,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
17151715
- allow_abbrev -- Allow long options to be abbreviated unambiguously
17161716
- exit_on_error -- Determines whether or not ArgumentParser exits with
17171717
error info when an error occurs
1718-
- suggest_on_error - Enables argument choice and subparser name
1719-
suggestions on user typo
1718+
- suggest_on_error - Enables suggestions for mistyped argument choices
1719+
and subparser names. (default: ``False``)
17201720
"""
17211721

17221722
def __init__(self,

0 commit comments

Comments
 (0)