Skip to content

Commit e69ff34

Browse files
authored
gh-65169: Clarify prog default in argparse (GH-31602)
1 parent e670a11 commit e69ff34

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Doc/library/argparse.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,12 @@ The following sections describe how each of these are used.
249249
prog
250250
^^^^
251251

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

258259
import argparse
259260
parser = argparse.ArgumentParser()

0 commit comments

Comments
 (0)