4 class Command_Reply extends Command_AbstractProps
6 public static function opts(\Console_CommandLine $optParser)
8 $cmd = $optParser->addCommand('reply');
9 static::optsGeneric($cmd);
14 'description' => 'URL that is replied to',
22 'description' => 'Reply text',
27 public function run(\Console_CommandLine_Result $cmdRes)
29 $url = Validator::url($cmdRes->args['url'], 'url');
34 $req = new Request($this->cfg->host, $this->cfg);
35 $req->req->addPostParameter('h', 'entry');
36 $req->req->addPostParameter('content', implode(' ', $cmdRes->args['text']));
37 $req->req->addPostParameter('in-reply-to', $url);
39 $this->handleGenericOptions($cmdRes, $req);
42 $postUrl = $res->getHeader('Location');
43 Log::info('Reply created at server');