Message152443
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 |
|
Date |
User |
Action |
Args |
2012-02-01 21:42:36 | wt | set | recipients:
+ wt |
2012-02-01 21:42:36 | wt | set | messageid: <1328132556.72.0.92385645061.issue13922@psf.upfronthosting.co.za> |
2012-02-01 21:42:36 | wt | link | issue13922 messages |
2012-02-01 21:42:35 | wt | create | |
|