/** * Callback method that registers a cli command. * * @param phpucConsoleInputDefinition $def The input definition container. * * @return void */ public function registerCommand(phpucConsoleInputDefinition $def) { $def->addCommand($this->getCommandId(), 'Creates a small CruiseControl example.'); $def->addArgument($this->getCommandId(), 'cc-install-dir', 'The installation directory of CruiseControl.'); }
/** * Callback method that registers a cli command. * * @param phpucConsoleInputDefinition $def The input definition container. * * @return void */ public function registerCommand(phpucConsoleInputDefinition $def) { $def->addCommand($this->getCommandId(), 'Removes old build artifacts and logs for a specified project.'); $def->addArgument($this->getCommandId(), 'cc-install-dir', 'The installation directory of CruiseControl.'); }
/** * Callback method that registers a cli command. * * @param phpucConsoleInputDefinition $def The input definition container. * * @return void */ public function registerCommand(phpucConsoleInputDefinition $def) { $def->addCommand($this->getCommandId(), 'Merges a set of PHPUnit logs into a single new file.'); }
/** * Callback method that registers a cli command. * * @param phpucConsoleInputDefinition $def The input definition container. * * @return void */ public function registerCommand(phpucConsoleInputDefinition $def) { $def->addCommand($this->getCommandId(), 'Installs CruiseControl start-up script for linux.'); $def->addArgument($this->getCommandId(), 'cc-install-dir', 'The installation directory of CruiseControl.'); $def->addArgument($this->getCommandId(), 'init-dir', 'Init scripts directory.'); }
/** * Callback method that registers a cli command. * * @param phpucConsoleInputDefinition $def The input definition container. * * @return void */ public function registerCommand(phpucConsoleInputDefinition $def) { $def->addCommand($this->getCommandId(), 'Generates the metric graphs with ezcGraph'); $def->addArgument($this->getCommandId(), 'project-log-dir', 'The project log directory.'); $def->addArgument($this->getCommandId(), 'project-output-dir', 'The graph output directory.', false); }
/** * Callback method that registers a cli command. * * @param phpucConsoleInputDefinition $def The input definition container. * * @return void */ public function registerCommand(phpucConsoleInputDefinition $def) { $def->addCommand($this->getCommandId(), 'Installs the CruiseControl patches.'); $def->addArgument($this->getCommandId(), 'cc-install-dir', 'The installation directory of CruiseControl.'); }
/** * Callback method that registers a cli command. * * @param phpucConsoleInputDefinition $def The input definition container. * * @return void */ public function registerCommand(phpucConsoleInputDefinition $def) { $def->addCommand($this->getCommandId(), 'Deletes a CruiseControl project with all logs and artifacts.'); $def->addArgument($this->getCommandId(), 'cc-install-dir', 'The installation directory of CruiseControl.'); $def->addOption($this->getCommandId(), 'j', 'project-name', 'The name of the project to be deleted.', true, null, true); }
/** * Tests that {@link phpucConsoleInputDefinition::addOption()} adds an option * to the internal data structure. * * @return void */ public function testAddOption() { $definition = new phpucConsoleInputDefinition(); $definition->addCommand('manuel', 'Hello World.'); $this->assertFalse($definition->hasOption('manuel', 'p1')); $this->assertFalse($definition->hasOption('manuel', 'pichler1')); $definition->addOption('manuel', 'p1', 'pichler1', 'Hello World.', null, null, false, phpucConsoleInputDefinition::MODE_HIDDEN); $this->assertTrue($definition->hasOption('manuel', 'p1')); $this->assertTrue($definition->hasOption('manuel', 'pichler1')); }
/** * Tests that {@link phpucConsoleInput::parse()} fails with an exception if * an option value doesn't match against the defined regexp. * * @return void */ public function testConsoleInputWithInvalidFormatedOptionValueFail() { $definition = new phpucConsoleInputDefinition(); $definition->addCommand('foo', 'The foo command.'); $definition->addOption('foo', 'b', 'bar', 'The bar option', '/^[0-9a-f]{4}\\-[0-9a-f]{2}$/D', null, true); $this->prepareArgv(array('foo', '--bar', '071a-0')); $this->setExpectedException('phpucConsoleException', "The value for option '--bar' has an invalid format."); $input = new phpucConsoleInput($definition); $input->parse(); }