4 class Command_Reply extends Command_AbstractProps
6 public static function opts(\Console_CommandLine $optParser)
8 $cmd = $optParser->addCommand('reply');
9 $cmd->description = 'Create a reply';
10 static::addOptHtml($cmd);
11 static::optsGeneric($cmd);
16 'description' => 'URL that is replied to',
24 'description' => 'Reply text',
29 public function run(\Console_CommandLine_Result $cmdRes)
31 $url = Validator::url($cmdRes->args['url'], 'url');
36 $req = new Request($this->cfg->host, $this->cfg);
37 $req->setType('entry');
38 $req->addProperty('in-reply-to', $url);
39 $req->addContent($cmdRes->args['text'], $cmdRes->options['html']);
41 $this->handleGenericOptions($cmdRes, $req);
44 $postUrl = $res->getHeader('Location');
45 Log::info('Reply created at server');