]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
argparse docs: prog default is the basename of argv[0] (GH-30298)
authorJade Lovelace <software@lfcode.ca>
Sun, 2 Jan 2022 20:16:25 +0000 (12:16 -0800)
committerGitHub <noreply@github.com>
Sun, 2 Jan 2022 20:16:25 +0000 (12:16 -0800)
Doc/library/argparse.rst
Lib/argparse.py

index 80c382a981b8d488b2d1b841f611aada94e979df..e050d6298b6ff6507ee31d6f44164b0fa61bb4c8 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 de95eedbee0ee64a9871bd48e292c1b0eb7c0fc1..1529d9e76873739edade94cbf8daa7b1004f8f8e 100644 (file)
@@ -1691,7 +1691,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