given this configuration command:
protected function configure() {
$this->setName('command:test')
->addOption("service", null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, "What services are desired ?", array(
"s1" => true,
"s2" => true,
"s3" => true,
"s4" => false,
"s5" => true,
"s6" => true,
"s7" => true,
"s8" => true,
"s9" => true
))
}
Now when calling the command, how do you pass the associate array.
#!/bin/bash
php app/console command:test --service s1:true --service s2:false --s3:true
Condition:
- I dont want to create 9+ options for this command.
- Ideally, I would like to preserve the defaults when I pass a new service.
- All, within the command definition if that's possible. That is no supporting code. No
if