]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-29030: Document interaction between *choices* and *metavar*. (GH-23884)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Tue, 22 Dec 2020 17:24:26 +0000 (09:24 -0800)
committerGitHub <noreply@github.com>
Tue, 22 Dec 2020 17:24:26 +0000 (09:24 -0800)
Doc/library/argparse.rst

index 1a298cdd2b5344f47381614bead95458a5057c80..4542961d7816ea5ba26c427c41f859bdb45cb941 100644 (file)
@@ -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
 ^^^^^^^^