stecman / symfony-console-completion

Automatic tab-key completion for Symfony console application options, arguments and parameters
MIT License
420 stars 26 forks source link

The "IS_ARRAY" argument aren't auto-completed #72

Open aik099 opened 7 years ago

aik099 commented 7 years ago

I have argument defined with InputArgument::REQUIRED | InputArgument::IS_ARRAY options, which means all non-matched arguments in command line are assigned to this one.

During auto-complete the 1st match is auto-completed just fine, but next matches aren't auto-completed at all.

The issue is in \Stecman\Component\Symfony\Console\BashCompletion\CompletionHandler::mapArgumentsToWords method, that only matches 1 word to 1 argument. So if I have more words then arguments the rest words are just not mapped anywhere, but should be mapped to array-type argument.

See the InputDefinition of Symfony Console for actual processing logic, but generally last defined array argument accepts all non-matched arguments.