Ejemplo n.º 1
0
 public function setupGetopt()
 {
     $getopt = new Getopt();
     $getopt->addOptions($this->getCommandlineOptions());
     $getopt->addOptions($this->xinc->getCommandlineOptions());
     $loader = $this->xinc->getConfigLoader();
     $getopt->addOptions($loader->getCommandlineOptions());
     // add more defaults
     $options = $getopt->getOptionObjects();
     $base = $options['working-dir']->getDefaultValue();
     $options['config-dir']->setDefaultValue("{$base}etc/xinc/");
     $options['project-dir']->setDefaultValue($options['config-dir']->getDefaultValue() . Xinc::DEFAULT_PROJECT_DIR . "/");
     return $getopt;
 }
Ejemplo n.º 2
0
 public function testAddOptionsFailsOnConflict()
 {
     $this->setExpectedException('\\InvalidArgumentException');
     $getopt = new Getopt(array(array('v', 'version')));
     $getopt->addOptions(array(array('v', 'verbose')));
 }