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

2019-11-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Bob, thanks for the suggestion.

Brandt, thanks for the PR.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-11-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset a0ed99bca8475cbc82e9202aa354faba2a4620f4 by Raymond Hettinger 
(Brandt Bucher) in branch 'master':
bpo-38438: Simplify argparse "star nargs" usage. (GH-17106)
https://github.com/python/cpython/commit/a0ed99bca8475cbc82e9202aa354faba2a4620f4


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-11-10 Thread Brandt Bucher


Brandt Bucher  added the comment:

I went ahead and opened a PR, since it's been a month.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-11-10 Thread Brandt Bucher


Change by Brandt Bucher :


--
keywords: +patch
pull_requests: +16612
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/17106

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-11-04 Thread Callum Ward


Change by Callum Ward :


--
nosy: +callumquick

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-10-24 Thread paul j3


Change by paul j3 :


--
nosy: +paul.j3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-10-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't think it's any more precise. It just seems verbose and confusing to me, 
while conveying the same information.

`[arg [arg ...]]` to me means "optionally, an arg followed by one or more 
optional args".

While `[arg ...]` to  me means "optionally, one or more args".

So, I'd vote for the simpler version, especially since we're presumably trying 
to communicate with people who aren't BNF or regex experts!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-10-11 Thread Brandt Bucher


Brandt Bucher  added the comment:

For backward compatibility with 2 metavars, the two-name form should still be 
possible. Just pass metavar=("FOO", "FOO").

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-10-11 Thread Nick Timkovich


Nick Timkovich  added the comment:

The `[arg [arg ...]]` feels a bit more formal to me, and I might prefer it in 
the example shown where the arg name is fairly short. That said, `man mv` shows 
something like:

mv [OPTION]... [-T] SOURCE DEST
mv [OPTION]... SOURCE... DIRECTORY
mv [OPTION]... -t DIRECTORY SOURCE...

--
nosy: +nicktimko

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-10-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Bob, as OP you get first dibs on a PR.
Brandt, you're next in line :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-10-11 Thread Brandt Bucher

Brandt Bucher  added the comment:

I’m happy to write one. This seems like a pretty straightforward fix.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-10-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Bob, would like to create a PR?

--
assignee:  -> rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-10-10 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-10-10 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-10-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think [arg ...] would make sense.

Removing 3.5 and 3.6, since they're in security only mode. Adding 3.9.

--
nosy: +eric.smith
versions: +Python 3.9 -Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-10-10 Thread Bob Alexander


New submission from Bob Alexander :

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com