symfony-console-completion icon indicating copy to clipboard operation
symfony-console-completion copied to clipboard

The "IS_ARRAY" argument aren't auto-completed

Open aik099 opened this issue 9 years ago • 0 comments

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.

aik099 avatar Nov 27 '16 16:11 aik099