]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
argparse docs: prog default is the basename of argv[0] (GH-30298) (GH-30339)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 2 Jan 2022 21:29:35 +0000 (13:29 -0800)
committerGitHub <noreply@github.com>
Sun, 2 Jan 2022 21:29:35 +0000 (13:29 -0800)
Doc/library/argparse.rst
Lib/argparse.py

index a056826774c5e545a732510a68e7c062ec53e1fa..d853d2afbe372fcb5d1621d02182c327effe2864 100644 (file)
@@ -148,7 +148,8 @@ ArgumentParser objects
    as keyword arguments. Each parameter has its own more detailed description
    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
      arguments added to parser)
index b2db312b8fdfd9056bf8894333fcca3948cfa79d..e177e4fe034d32fb00a0e5e4f7969fd26ca3082a 100644 (file)
@@ -1672,7 +1672,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
     """Object for parsing command line strings into Python objects.
 
     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)
         - description -- A description of what the program does
         - epilog -- Text following the argument descriptions