Steven Bethard <steven.beth...@gmail.com> added the comment:

This is closely related to issue 9338. The parser should know that your command 
line requires at least the COMMAND argument, so it should stop parsing in time 
for that. However, in the case of subcommands, even if we solved issue 9338, 
you would still get the behavior that

./script.py --ignore one two COMMAND arg1 arg2

would get parsed as "arg2" being the command. So I guess there still ought to 
be a way to tell argparse to stop parsing nargs='+' optionals.

Seems like there's also a bug in the current behavior - you should get an error 
saying that no command was given, not an error saying you issued the command 
"--".

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9571>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to