public function addCommand(nbCommand $command) { if ($this->hasCommand($command->getFullName(), false)) { throw new InvalidArgumentException(sprintf("[nbCommandSet::addCommand] Command %s already exists", $command->getFullName())); } $this->commands[$command->getFullName()] = $command; }
protected function executeCommand(nbCommand $command, $commandLine, $doit, $verbose) { if ($doit) { $parser = new nbCommandLineParser(); $parser->setDefaultConfigurationDirs($this->getParser()->getDefaultConfigurationDirs()); $command->run($parser, $commandLine); } if ($verbose) { $this->logLine(sprintf("%s %s\n", $command->getFullName(), $commandLine), nbLogger::COMMENT); } }
public function addCommand(nbCommand $command) { $this->commands[] = $command; $briefDescription = $this->getBriefDescription() . ' -> ' . $command->getFullName(); $this->setBriefDescription($briefDescription); }