public function getParams()
{
$params = new \StdClass();
$cliFactory = new CliFactory();
$context = $cliFactory->newContext($GLOBALS);
$stdio = $cliFactory->newStdio();
$getopt = $context->getopt(['server1::', 'server2::', 'format::', 'template::', 'type::', 'include::', 'nocomments::', 'config::', 'output::', 'debug::']);
$input = $getopt->get(1);
if ($input) {
$params->input = $this->parseInput($input);
} else {
throw new CLIException("Missing input");
}
if ($getopt->get('--server1')) {
$params->server1 = $this->parseServer($getopt->get('--server1'));
}
if ($getopt->get('--server2')) {
$params->server2 = $this->parseServer($getopt->get('--server2'));
}
if ($getopt->get('--format')) {
$params->format = $getopt->get('--format');
}
if ($getopt->get('--template')) {
$params->template = $getopt->get('--template');
}
if ($getopt->get('--type')) {
$params->type = $getopt->get('--type');
}
if ($getopt->get('--include')) {
$params->include = $getopt->get('--include');
}
if ($getopt->get('--nocomments')) {
$params->nocomments = $getopt->get('--nocomments');
}
if ($getopt->get('--config')) {
$params->config = $getopt->get('--config');
}
if ($getopt->get('--output')) {
$params->output = $getopt->get('--output');
}
if ($getopt->get('--debug')) {
$params->debug = $getopt->get('--debug');
}
return $params;
}