/** * Helper to get instance of DirectoryScanner with cli options applied * * @param ezcConsoleInput $input CLI Options pased to app * * @return Theseer\Tools\IncludeExcludeFilterIterator */ protected function getScanner(\ezcConsoleInput $input) { $scanner = new DirectoryScanner(); $include = $input->getOption('include'); if (is_array($include->value)) { $scanner->setIncludes($include->value); } else { $scanner->addInclude($include->value); } $exclude = $input->getOption('exclude'); if ($exclude->value) { if (is_array($exclude->value)) { $scanner->setExcludes($exclude->value); } else { $scanner->addExclude($exclude->value); } } $args = $input->getArguments(); return $scanner($args[0]); }