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 wt
Recipients bethard, eric.smith, kalt, wt
Date 2012-02-16.07:27:44
SpamBayes Score 1.4386332e-07
Marked as misclassified No
Message-id <1329377265.35.0.706242205223.issue13922@psf.upfronthosting.co.za>
In-reply-to
Content
Using argparse.REMAINDER will not help for my problem in my real program as the first arg needs to be handled by my program and mapped into the real binary name.

If I recall correctly from memory, the following is what happened when I tried using argparse.REMAINDER. If call my program like so:
$ hack run :target --help

The subcommand will be "run" in this case. Because :target is handled by argparse, the "--help" will not be seen as part of the remainder of the arguments, and I will get the help for the "hack run" subcommand instead of the target binary getting the --help argument. I have pushed most of the program to [1] if you want to take a look. Specifically, see cli/commands/run.py:do_run for that bit of code that handles the run subcommand.

[1]https://github.com/wt/repo-digg-dev-hackbuilder
History
Date User Action Args
2012-02-16 07:27:45wtsetrecipients: + wt, bethard, eric.smith, kalt
2012-02-16 07:27:45wtsetmessageid: <1329377265.35.0.706242205223.issue13922@psf.upfronthosting.co.za>
2012-02-16 07:27:44wtlinkissue13922 messages
2012-02-16 07:27:44wtcreate