symfony/Console — pull request #11 by flip111 (2014-05-09 23:53:23+00:00)
Title: Added Interactive command trait.

Hi,

This a Proof of Concept PR which makes commands interactive when arguments are missing.

Missing in PR & notes:
* Compatibility (traits not available in PHP 5.3)
* Tests
* All `Command` properties have been set to protected, but only some are needed in the trait.

Possible extra features:
* Take configuration flags to:
- Ask for options
* "Give a value for: 'iterations'" <- `Question` when not `InputOption::VALUE_NONE`
* "Set option 'yell'?" <- `ConfirmationQuestion` for `InputOption::VALUE_NONE`
- Ask to ask for options "would you like to specify any options?"

The programmer could enable this on his application to provide for extra features.

Example on [`GreetCommand`](http://symfony.com/doc/master/components/console/introduction.html#creating-a-basic-command) put `InputArgument::REQUIRED` for argument `name`. Then run `php application.php demo:greet`, the application will now ask: `Who do you want to greet?`