From 6321e1ce4b8702c5b84c1c8c812c663b8f237953 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Sat, 26 Feb 2022 23:12:11 -0800 Subject: [PATCH] Update argparse.rst --- Doc/library/argparse.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index e050d6298b6ff6..ddbd398517c25e 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -199,11 +199,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()