Implement support for arrays in command arguments

fixes #6709