symfony/symfony — pull request #5417 by nfx (2012-09-02 19:37:28+00:00)
Title: [Console] Add ability to select values interactively

Adds ability to select from value list:

$values = array('One', 'Two', 'Three');
$pick = $this->getHelper('dialog')->select($output, 'Pick a bundle:', $values, 2, array(
'return' => 'value'
));
var_dump($pick);

... would give the following CLI output:

Pick a bundle:
0 One
1 Two
2 Three
> 1
string(3) "Two"