Message385507
I was thinking of a refactoring that included the ', '.join(...) loop, but on further thought your refactoring might be enough for the case I raised.
For example:
def _format_option_with_args(self, option_string, args_string):
if option_string.startswith('--'):
return '%s %s' % (option_string, args_string)
return '%s' % option_string
would produce a
-f, --foo FOO something
and
def _format_option_with_args(self, option_string, args_string):
return option_string
would produce
-f, --foo something
I wonder if this refactoring merits some mention in the documentation. Or maybe the GnuStyleLongOptionsHelpFormatter subclass is enough of an example. The details of how other formatter subclasses work aren't documented, but they are available to developers who can read the code. |
|
Date |
User |
Action |
Args |
2021-01-22 19:08:35 | paul.j3 | set | recipients:
+ paul.j3, rhettinger, will |
2021-01-22 19:08:35 | paul.j3 | set | messageid: <1611342515.11.0.199917775517.issue42980@roundup.psfhosted.org> |
2021-01-22 19:08:35 | paul.j3 | link | issue42980 messages |
2021-01-22 19:08:35 | paul.j3 | create | |
|