case 'like':
$this->requireValidHost();
- $cmd = new Command_Like($this->cfg->host);
+ $cmd = new Command_Like($this->cfg);
$cmd->run($res->command->args['url']);
break;
case 'reply':
$this->requireValidHost();
- $cmd = new Command_Reply($this->cfg->host);
+ $cmd = new Command_Reply($this->cfg);
$cmd->run(
$res->command->args['url'],
implode(' ', $res->command->args['text'])
} else {
$this->cfg->host = $this->cfg->hosts[$key];
}
+ } else {
+ $key = $this->cfg->getDefaultHost();
+ if ($key !== null) {
+ $this->cfg->host = $this->cfg->hosts[$key];
+ }
}
if ($opts['user'] !== null) {
$this->cfg->host->user = $opts['user'];
}
+ $this->cfg->setDebug($opts['debug']);
return $res;
} catch (\Exception $exc) {
'default' => null,
)
);
+ $optParser->addOption(
+ 'debug',
+ array(
+ 'short_name' => '-d',
+ 'long_name' => '--debug',
+ 'description' => 'Verbose output',
+ 'action' => 'StoreTrue',
+ 'default' => false,
+ )
+ );
$cmd = $optParser->addCommand('connect');
$cmd->addOption(