[issue41856] argparse: auto-generated synopsis omits REMAINDER argument

Reuben Thomas report at bugs.python.org
Thu Sep 24 19:42:31 EDT 2020


Reuben Thomas <rrt at sc3d.org> added the comment:

A workaround to help users for now is:

>>> parser.add_argument('args', metavar='...', nargs=argparse.REMAINDER)

as then at least the help entry corresponds to the synopsis:

positional arguments:
  command
  ...

And with a `help` string, this can be clarified further, e.g.:

>>> parser.add_argument('args', metavar='...', nargs=argparse.REMAINDER, help='arguments to the command')

----------

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


More information about the Python-bugs-list mailing list