public function run() { $this->concentrator = new Concentrate_Concentrator(); $this->parser = Console_CommandLine::fromXmlFile($this->getUiXml()); try { $result = $this->parser->parse(); $this->setOptions($result->options); $this->setWebRoot($result->args['webroot']); $this->loadDataFiles(); if ($this->combine) { $this->writeCombinedFiles(); $this->writeCombinedFlagFile(); } if ($this->compile) { $this->writeCompiledFiles(); $this->writeCompiledFlagFile(); } if ($this->minify) { $this->writeMinifiedFiles(); $this->writeMinifiedFlagFile(); } } catch (Console_CommandLine_Exception $e) { $this->displayError($e->getMessage() . PHP_EOL); } catch (Exception $e) { $this->displayError($e->getMessage() . PHP_EOL, false); $this->displayError($e->getTraceAsString() . PHP_EOL); } }
/** * Gets the CLI parser for this pinentry * * @return Console_CommandLine the CLI parser for this pinentry. */ protected function getCommandLineParser() { return Console_CommandLine::fromXmlFile($this->getUIXML()); }
* http://opensource.org/licenses/mit-license.php * * @category Console * @package Console_CommandLine * @author David JEAN LOUIS <*****@*****.**> * @copyright 2007 David JEAN LOUIS * @license http://opensource.org/licenses/mit-license.php MIT License * @version CVS: $Id$ * @link http://pear.php.net/package/Console_CommandLine * @since File available since release 0.1.0 */ // Include the Console_CommandLine package. require_once 'Console/CommandLine.php'; // create the parser $xmlfile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ex4.xml'; $parser = Console_CommandLine::fromXmlFile($xmlfile); // run the parser try { $result = $parser->parse(); if ($result->command_name) { $st = $result->command->options['reverse'] ? strrev($result->command->args['text']) : $result->command->args['text']; if ($result->command_name == 'foo') { echo "Foo says: {$st}\n"; } else { if ($result->command_name == 'bar') { echo "Bar says: {$st}\n"; } } } } catch (Exception $exc) { $parser->displayError($exc->getMessage());