summaryrefslogtreecommitdiffstats
path: root/Doc/library/argparse.rst
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2020-12-22 17:24:26 (GMT)
committerGitHub <noreply@github.com>2020-12-22 17:24:26 (GMT)
commit6afb730e2a8bf0b472b4c3157bcf5b44aa7e6d56 (patch)
tree421a8d366b4dced625b29e7726ccd29469eb2996 /Doc/library/argparse.rst
parent60eccd095624f39195cc5ae0b49a59022bbbb028 (diff)
downloadcpython-6afb730e2a8bf0b472b4c3157bcf5b44aa7e6d56.zip
cpython-6afb730e2a8bf0b472b4c3157bcf5b44aa7e6d56.tar.gz
cpython-6afb730e2a8bf0b472b4c3157bcf5b44aa7e6d56.tar.bz2
bpo-29030: Document interaction between *choices* and *metavar*. (GH-23884)
Diffstat (limited to 'Doc/library/argparse.rst')
-rw-r--r--Doc/library/argparse.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index 1a298cd..4542961 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -1152,6 +1152,11 @@ Any container can be passed as the *choices* value, so :class:`list` objects,
Use of :class:`enum.Enum` is not recommended because it is difficult to
control its appearance in usage, help, and error messages.
+Formatted choices overrides the default *metavar* which is normally derived
+from *dest*. This is usually what you want because the user never sees the
+*dest* parameter. If this display isn't desirable (perhaps because there are
+many choices), just specify an explicit metavar_.
+
required
^^^^^^^^