public function __construct($args = array()) { $args = array_merge(array('usage' => null, 'optionList' => null, 'optionClass' => 'Horde_Argv_Option', 'version' => null, 'conflictHandler' => "error", 'description' => null, 'formatter' => null, 'addHelpOption' => true, 'prog' => null, 'epilog' => null, 'allowInterspersedArgs' => true, 'allowUnknownArgs' => false, 'ignoreUnknownArgs' => false), $args); parent::__construct($args['optionClass'], $args['conflictHandler'], $args['description']); $this->setUsage($args['usage']); $this->prog = $args['prog']; $this->version = $args['version']; $this->allowInterspersedArgs = $args['allowInterspersedArgs']; $this->allowUnknownArgs = $args['allowUnknownArgs']; $this->ignoreUnknownArgs = $args['ignoreUnknownArgs']; if (is_null($args['formatter'])) { $args['formatter'] = new Horde_Argv_IndentedHelpFormatter(); } $this->formatter = $args['formatter']; $this->formatter->setParser($this); $this->epilog = $args['epilog']; // Populate the option list; initial sources are the // standardOptionList class attribute, the 'optionList' // argument, and (if applicable) the _addVersionOption() and // _addHelpOption() methods. $this->_populateOptionList($args['optionList'], $args['addHelpOption']); $this->_initParsingState(); }
public function __construct($parser, $title, $description = null) { $this->parser = $parser; parent::__construct($parser->optionClass, $parser->conflictHandler, $description); $this->_title = $title; }