[issue9182] argparse: optional argument w/ narg='+' conflicts w/ positional argsument
Éric Araujo <merwok@netwok.org> added the comment: I was suggesting a doc bug only if the current doc didn’t advertise clearly this way of combining nargs with positional arguments. Using “--” is most certainly standard and right, Using “--” to explicitly signal positional arguments is most certainly right and standard, but people have to read about that for the first time somewhere. In a perfect world, that would be in their shell’s man page, but better add a word about it in the reference. The “--” marker is actually mentioned in one section: http://docs.python.org/dev/library/argparse#arguments-containing I’m reopening, suggesting that a line be added to explain the standard “--” separator for use cases like Sergey’s. ---------- assignee: -> docs@python components: +Documentation -Library (Lib) nosy: +docs@python resolution: invalid -> stage: -> needs patch status: closed -> open _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9182> _______________________________________
On Tue, Jul 6, 2010 at 4:33 PM, Éric Araujo <report@bugs.python.org> wrote:
Using “--” to explicitly signal positional arguments is most certainly right and standard, but people have to read about that for the first time somewhere. In a perfect world, that would be in their shell’s man page, but better add a word about it in the reference.
It's a convention; not all applications in the larger world support it at all. It needs to be documented for argparse, and also for specific applications (which may or may not be built using argparse or Python. This does not belong in the shell documentation unless needed for the shell itself.
participants (2)
-
Fred Drake -
Éric Araujo