This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bethard
Recipients bethard, elsdoerfer, r.david.murray
Date 2010-08-12.08:43:06
SpamBayes Score 9.250988e-07
Marked as misclassified No
Message-id <1281602589.79.0.427815597599.issue9571@psf.upfronthosting.co.za>
In-reply-to
Content
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 "--".
History
Date User Action Args
2010-08-12 08:43:10bethardsetrecipients: + bethard, r.david.murray, elsdoerfer
2010-08-12 08:43:09bethardsetmessageid: <1281602589.79.0.427815597599.issue9571@psf.upfronthosting.co.za>
2010-08-12 08:43:07bethardlinkissue9571 messages
2010-08-12 08:43:06bethardcreate