Skip to content

Commit

Permalink
[3.12] gh-65169: Clarify prog default in argparse (GH-31602) (GH-124431)
Browse files Browse the repository at this point in the history
(cherry picked from commit e69ff34)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
  • Loading branch information
miss-islington and slateny committed Sep 24, 2024
1 parent 1854224 commit ed44377
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Doc/library/argparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,12 @@ The following sections describe how each of these are used.
prog
^^^^

By default, :class:`ArgumentParser` objects use ``sys.argv[0]`` to determine
By default, :class:`ArgumentParser` objects use the base name
(see :func:`os.path.basename`) of ``sys.argv[0]`` to determine
how to display the name of the program in help messages. This default is almost
always desirable because it will make the help messages match how the program was
invoked on the command line. For example, consider a file named
``myprogram.py`` with the following code::
always desirable because it will make the help messages match the name that was
used to invoke the program on the command line. For example, consider a file
named ``myprogram.py`` with the following code::

import argparse
parser = argparse.ArgumentParser()
Expand Down

0 comments on commit ed44377

Please # to comment.