/**
* Main executor method
*
* @return void
*/
public function run()
{
try {
$input = $this->setupInput();
$input->process();
if ($input->getOption('help')->value === TRUE) {
$this->showVersion();
$this->showUsage();
exit(CLI::RC_OK);
}
if ($input->getOption('version')->value === TRUE) {
$this->showVersion();
exit(CLI::RC_OK);
}
$config = $this->configure($input);
$this->factory->setConfig($config);
if (!$config->isQuietMode()) {
$this->showVersion();
}
$rc = $this->factory->getApplication()->run();
exit($rc);
} catch (\ezcConsoleException $e) {
$this->showVersion();
echo $e->getMessage() . "\n\n";
$this->showUsage();
exit(CLI::RC_PARAM_ERROR);
} catch (\Exception $e) {
$this->showVersion();
fwrite(STDERR, "\nError while processing request:\n - " . $e->getMessage() . "\n");
exit(CLI::RC_EXEC_ERROR);
}
}