protected function _configuration(array $options = array())
{
$configs = (array) Catalog::config();
if (isset($configs['temporary'])) {
unset($configs['temporary']);
}
if ($configs) {
$this->out('Available `Catalog` Configurations:');
$prompt = 'Please choose a configuration or hit enter to add a new one:';
foreach ($configs as $name => $config) {
$this->out(" - {$name}");
}
} else {
$this->out(' - No configuration found. -');
$prompt = 'Please hit enter to add a temporary configuration:';
}
$this->out();
$name = $this->in($prompt, array('choices' => array_keys($configs), 'default' => 'temporary'));
if ($name == 'temporary') {
foreach ($options as $option => $default) {
$configs[$name][$option] = $this->in(ucfirst($option) . ':', compact('default'));
}
Catalog::config($configs);
}
return $name;
}