]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-65169: Clarify prog default in argparse (GH-31602) (#124430)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 24 Sep 2024 18:26:32 +0000 (20:26 +0200)
committerGitHub <noreply@github.com>
Tue, 24 Sep 2024 18:26:32 +0000 (11:26 -0700)
gh-65169: Clarify prog default in argparse (GH-31602)
(cherry picked from commit e69ff34e81eceb69de6623205c87e0145f1831e4)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Doc/library/argparse.rst

index 5f7cecd2cad18ea71a53c416ce214c5ed5c04839..53ecc97d5659f4382f6c88806c1a3a36c71c884e 100644 (file)
@@ -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()