setName('generate') ->setDescription('Generate documentation') ->addOption('configuration', 'c', InputArgument::OPTIONAL, 'Configuration file') ->addOption('format', 'f', InputArgument::OPTIONAL, 'Output format, html or confluence', 'html') ->addOption('processor', 'p', InputArgument::OPTIONAL, 'Manipulations on the tree', 'none') ->addOption('destination', 'd', InputArgument::OPTIONAL, $description, 'static'); } protected function execute(InputInterface $input, OutputInterface $output) { $daux = new Daux(Daux::STATIC_MODE); $daux->initialize($input->getOption('configuration')); $width = $this->getApplication()->getTerminalDimensions()[0]; $processor = $input->getOption('processor'); if (!empty($processor) && $processor != 'none') { $class = "\\Todaymade\\Daux\\Extension\\" . $processor; if (class_exists($class)) { $daux->setProcessor(new $class($daux, $output, $width)); } else if (file_exists($processor)) { include $processor; } } // Improve the tree with a processor $daux->getProcessor()->manipulateTree($daux->tree); switch(strtolower($input->getOption('format'))) { case 'confluence': (new ConfluenceGenerator())->generate($daux, $output, $width); break; case 'html': default: (new HTMLGenerator())->generate($daux, $input->getOption('destination'), $output, $width); } } }