argparse docs: prog default is the basename of argv[0] (GH-30298)

This commit is contained in:
Jade Lovelace 2022-01-02 12:16:25 -08:00 committed by GitHub
parent ba00f0d93a
commit 8e75c6b49b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -148,7 +148,8 @@ ArgumentParser objects
as keyword arguments. Each parameter has its own more detailed description as keyword arguments. Each parameter has its own more detailed description
below, but in short they are: below, but in short they are:
* prog_ - The name of the program (default: ``sys.argv[0]``) * prog_ - The name of the program (default:
``os.path.basename(sys.argv[0])``)
* usage_ - The string describing the program usage (default: generated from * usage_ - The string describing the program usage (default: generated from
arguments added to parser) arguments added to parser)

View file

@ -1691,7 +1691,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
"""Object for parsing command line strings into Python objects. """Object for parsing command line strings into Python objects.
Keyword Arguments: Keyword Arguments:
- prog -- The name of the program (default: sys.argv[0]) - prog -- The name of the program (default:
``os.path.basename(sys.argv[0])``)
- usage -- A usage message (default: auto-generated from arguments) - usage -- A usage message (default: auto-generated from arguments)
- description -- A description of what the program does - description -- A description of what the program does
- epilog -- Text following the argument descriptions - epilog -- Text following the argument descriptions