[issue42023] Argparse: Add a "display" arg

paul j3 report at bugs.python.org
Tue Oct 13 23:13:23 EDT 2020


paul j3 <ajipanca at gmail.com> added the comment:

I'm not following this request either, especially the colored part.

However, I can imagine adding a variable that gives the user full control over the action-invocation.  In:

    argparse.HelpFormatter._format_action_invocation method.

Currently it accepts the metavar (but not the tuple version) for a positional, but for optionals constructs:

  -s ARGS, --long ARGS

This can be quite long and ugly if the ARGS is a long choices, or there are many flag alternatives.  A number of SO users have asked for something simpler, usually with just on flag or

  -s, --long ARGS

There may even be a bug/issue(s) related to this already.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42023>
_______________________________________


More information about the Python-bugs-list mailing list