[New-bugs-announce] [issue38438] argparse "usage" overly-complex with nargs="*"

Bob Alexander report at bugs.python.org
Thu Oct 10 16:24:39 EDT 2019


New submission from Bob Alexander <bobjalex at gmail.com>:

This program:

import argparse
ap = argparse.ArgumentParser()
ap.add_argument("arg", nargs="*")
ap.parse_args()

Gives usage message:
usage: help_complexity.py [-h] [arg [arg ...]]

It's correct, but unnecessarily complex and challenging to the user.
If I were manually writing the usage, arg... would do, or maybe [arg ...] to be consistent with other messages??

----------
components: Library (Lib)
messages: 354402
nosy: bobjalex
priority: normal
severity: normal
status: open
title: argparse "usage" overly-complex with nargs="*"
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8

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


More information about the New-bugs-announce mailing list