/** * Build options list. * * @param AbstractConsole $console * * @return array */ private function buildOptions(AbstractConsole $console) { $options = $console->getDefinition()->getOptions(); $data = array(); foreach ($options as $option) { $shortcut = ' '; $required = ''; if (null !== ($short = $option->getShortcut())) { $shortcut = sprintf('-%s, ', $short); } if ($option->isRequired()) { $required = '=' . strtoupper($option->getName()); } $data[] = ' ' . sprintf('<style name="info">%s</style>', $shortcut . sprintf('--%s', $option->getName()) . $required); } return $data; }
/** * Add console to application. * * @param AbstractConsole $console */ public function addConsole(AbstractConsole $console) { $console->setApplication($this); $console->getDefinition()->merge($this->definition); $this->consoles[$console->getName()] = $console; }