summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/argparse.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index a469554..c5882c2 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -192,6 +192,12 @@ arguments it contains. The default message can be overridden with the
The ``%(prog)s`` format specifier is available to fill in the program name in
your usage messages.
+When a custom usage message is specified for the main parser, you may also want to
+consider passing the ``prog`` argument to :meth:`~ArgumentParser.add_subparsers`
+or the ``prog`` and the ``usage`` arguments to
+:meth:`~_SubParsersAction.add_parser`, to ensure consistent command prefixes and
+usage information across subparsers.
+
.. _description:
@@ -1810,6 +1816,10 @@ Sub-commands
.. versionchanged:: 3.7
New *required* keyword-only parameter.
+ .. versionchanged:: 3.14
+ Subparser's *prog* is no longer affected by a custom usage message in
+ the main parser.
+
FileType objects
^^^^^^^^^^^^^^^^