Message367537
The display of the choices has been discussed in previous issues. When the choices is long there isn't a clean way of handling the display.
I'd suggest using a 'metavar' to show a short value, and then enumerate the choices in the help text. Use the 'Raw' help formatter to handle newlines as desired.
Choices get displayed in 3 places - the usage, the help, and error messages. Metavar replaces 2 of those.
An alternative to choices is a custom 'type' function. An example would be all integers between 0 and 100. Choices would work, but make a poor display regardless of formatting. |
|
Date |
User |
Action |
Args |
2020-04-28 15:50:18 | paul.j3 | set | recipients:
+ paul.j3, rhettinger, Leonid Ilyevsky |
2020-04-28 15:50:18 | paul.j3 | set | messageid: <1588089018.59.0.269581028155.issue40420@roundup.psfhosted.org> |
2020-04-28 15:50:18 | paul.j3 | link | issue40420 messages |
2020-04-28 15:50:18 | paul.j3 | create | |
|