Use separated function to resolve command and related arguments

Hi,

This PR split command and related arguments resolution into two distinct functions.

It will help to solve the HHVM issue https://github.com/sensiolabs/SensioDistributionBundle/pull/150 .

Thanks,

Jérémy