Use separated function to resolve command and related arguments
bug #11497 Use separated function to resolve command and related arguments (JJK801)

This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11497).

Discussion
----------

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 sensiolabs/SensioDistributionBundle#150 .

Thanks,

Jérémy

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

Commits
-------

ee75af0 Use separated function to resolve command and related arguments