3

I want to use the Symfony console component to make a command like this:

app/console config:set someConfigName=someValue anotherConfig=anotherValue

I found this question: Variable number of options for symfony/console component

But it seems unmaintainable to hack ArgvInput and pass it to $app->run(). I'd have to also hack ArrayInput and StringInput, in order to do unit testing, and I'm not sure I'd be able to inject them in the test.

Any help appreciated.

Community
  • 1
  • 1
paul-m
  • 214
  • 1
  • 7
  • This is some kind of [developer experience](http://symfony.com/blog/making-the-symfony-experience-exceptional) and is be worth to [create a feature request](https://github.com/symfony/symfony/issues?labels=DX&page=1&state=open) :) – Emii Khaos Jun 21 '14 at 08:43
  • you dont wanna use the `InputOption`? – Rufinus Jun 21 '14 at 10:34

1 Answers1

0

Feel kind of silly about this. :-)

Arguments are always a space-delimited string, and key=value looks like a space-delimited string. Explode the string with = as the delimiter, and you have the key and the value.

paul-m
  • 214
  • 1
  • 7