paul j3 added the comment:
This patch fixes the problem by joining the metavar terms with '|'. So the
help for the test case (adapted from an existing tuple test) looks like:
usage: PROG [-h] W1 [W2 ...] [X1 [X2 ...]] Y1 Y2 Y3 [Z1]
positional arguments:
W1|W2 w
X1|X2 x
Y1|Y2|Y3 y
Z1 z
Alternatives include:
- use ',',' ',or '/' instead of '|'
- use just the 1st item of the tuple
- use the default (non-tuple) metavar in the help line
These all pass existing tests.
The last alternative would use:
#metavar = '|'.join(metavar)
if len(metavar)>1:
metavar = default
else:
metavar = metavar[0]
----------
keywords: +patch
Added file: http://bugs.python.org/file31042/issue14074.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue14074>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com