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 wt
Date 2012-02-01.21:42:35
SpamBayes Score 8.000277e-09
Marked as misclassified No
Message-id <1328132556.72.0.92385645061.issue13922@psf.upfronthosting.co.za>
In-reply-to
Content
I have a program that runs something like the following:
$ hack run -- :target --arg1 --arg2 arg3 arg4

This basically runs a program identified by :target with the args. However, I cannot pass "--" to the program. For example, if I type:
$ hack run -- :hack run -- :target clean --help

the second "--" is swallowed by the parser, and I get an the help for "hack run" instead of instead of "hack clean". The run subcommand just does the following:

all_args = [target.bin_path] + args.args
os.execv(target.bin_path, all_args)

However, the first hack run has the following list for args:
args = Namespace(args=['run', ':hack', 'clean', '--help'], func=<function do_run at 0x19c3e60>, target=':hack')

Where is the second "--"? I would have expected the args list to be:
args=['run', '--', ':hack', 'clean', '--help']

About the python version, I am using python 2.6. However, I am using the latest release of argparse from [1] and am assuming that it's very similar code.

[1]http://code.google.com/p/argparse/downloads/list
History
Date User Action Args
2012-02-01 21:42:36wtsetrecipients: + wt
2012-02-01 21:42:36wtsetmessageid: <1328132556.72.0.92385645061.issue13922@psf.upfronthosting.co.za>
2012-02-01 21:42:36wtlinkissue13922 messages
2012-02-01 21:42:35wtcreate