diff options
author | Savannah Ostrowski <savannahostrowski@gmail.com> | 2024-09-25 22:22:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-25 22:22:17 (GMT) |
commit | 4e2fb7bdf5e1b2eddeb29b776820cfa2017a673f (patch) | |
tree | aa71770f0b4aa364c7dfa052bb511daa98e5a4ab /Doc | |
parent | 9968caa0cc8a4d07595f0e0abe5f28ba9b6f7a96 (diff) | |
download | cpython-4e2fb7bdf5e1b2eddeb29b776820cfa2017a673f.zip cpython-4e2fb7bdf5e1b2eddeb29b776820cfa2017a673f.tar.gz cpython-4e2fb7bdf5e1b2eddeb29b776820cfa2017a673f.tar.bz2 |
GH-58058: Add quick reference for `ArgumentParser` to argparse docs (gh-124227)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/argparse.rst | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 53ecc97..d5a2189 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -25,6 +25,25 @@ will figure out how to parse those out of :data:`sys.argv`. The :mod:`argparse` module also automatically generates help and usage messages. The module will also issue errors when users give the program invalid arguments. +Quick Links for ArgumentParser +--------------------------------------- +========================= =========================================================================================================== ================================================================================== +Name Description Values +========================= =========================================================================================================== ================================================================================== +prog_ The name of the program Defaults to ``os.path.basename(sys.argv[0])`` +usage_ The string describing the program usage +description_ A brief description of what the program does +epilog_ Additional description of the program after the argument help +parents_ A list of :class:`ArgumentParser` objects whose arguments should also be included +formatter_class_ A class for customizing the help output ``argparse.HelpFormatter`` +prefix_chars_ The set of characters that prefix optional arguments Defaults to ``'-'`` +fromfile_prefix_chars_ The set of characters that prefix files to read additional arguments from Defaults to ``None`` (meaning arguments will never be treated as file references) +argument_default_ The global default value for arguments +allow_abbrev_ Allows long options to be abbreviated if the abbreviation is unambiguous ``True`` or ``False`` (default: ``True``) +conflict_handler_ The strategy for resolving conflicting optionals +add_help_ Add a ``-h/--help`` option to the parser ``True`` or ``False`` (default: ``True``) +exit_on_error_ Determines whether or not to exit with error info when an error occurs ``True`` or ``False`` (default: ``True``) +========================= =========================================================================================================== ================================================================================== Core Functionality ------------------ |