> The problem here is that "-c" looks like an option. The simplest ways
Yes, and reason why is because the shell that executes the vm will remove the " So what I would get is command --option1 "-c -P" --option2 [--option1] [-c -P] [--option2] Now we *could* say that since there are obviously two options in one string of the array it must have been surrounded by a " ...which means it was not meant to be option but an argument. Not sure if that's always valid. But on the first glance this makes sense to me. WDYT? > around it are to use the -- "consume remaining" to capture the things > that look like short options: > command --options1 -- -c -P --option2 > But you do run the risk of -c, -P and -option2 being consumed as > arguments to --option1. That doesn't work for me. I cannot really easily change the way commandline is looking like. (needs to be compatible to a legacy app) > Alternatively you could set up your > DefaultOptionBuilder with something other than "-" for the short option > prefix - if you're not using short options at all then reusing "--" > should skirt around the issue pretty well. Hm... that's an idea :) cheers -- Torsten
signature.asc
Description: OpenPGP digital signature
