mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
argparse docs: prog default is the basename of argv[0] (GH-30298)
This commit is contained in:
parent
ba00f0d93a
commit
8e75c6b49b
2 changed files with 4 additions and 2 deletions
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue