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

Reuben Thomas report at bugs.python.org
Thu Sep 24 19:40:02 EDT 2020


New submission from Reuben Thomas <rrt at sc3d.org>:

Consider the following example from the Python documentation:

>>> parser = argparse.ArgumentParser(prog='PROG')
>>> parser.add_argument('--foo')
>>> parser.add_argument('command')
>>> parser.add_argument('args', nargs=argparse.REMAINDER)

Now show the help:

>>> parser.parse_args(['-h'])

This prints:

usage: PROG [-h] [--foo FOO] command ...

positional arguments:
  command
  args

Note that "args" is not shown in the synopsis. I suggest that the synopsis should instead say:

usage: PROG [-h] [--foo FOO] command args...

----------
components: Library (Lib)
messages: 377469
nosy: rrt
priority: normal
severity: normal
status: open
title: argparse: auto-generated synopsis omits REMAINDER argument
versions: Python 3.8

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


More information about the New-bugs-announce mailing list