/** * Process command * * @return string */ public function process() { try { $this->command = $this->parser->parse(); if (empty($this->command->command_name)) { $this->parser->displayUsage(); self::end(0); } $return = $this->controller->execute($this->command->command_name, $this->command->command->options, $this->command->command->args, $this->color, $this->logger, $this->tasks); } catch (ShellException $se) { $this->parser->displayError($this->color->convert("\n\n%R" . $se->getMessage() . "%n\n")); self::end(1); } catch (Exception $e) { $this->parser->displayError($this->color->convert("\n\n%r" . $e->getMessage() . "%n\n")); self::end(1); } echo "\n" . $return . "\n\n"; self::end(0); }