4 class Command_Reply extends Command_AbstractProps
11 public function __construct($cfg)
16 public static function opts(\Console_CommandLine $optParser)
18 $cmd = $optParser->addCommand('reply');
19 static::optsGeneric($cmd);
24 'description' => 'URL that is replied to',
32 'description' => 'Reply text',
37 public function run(\Console_CommandLine_Result $cmdRes)
39 $url = Validator::url($cmdRes->args['url'], 'url');
44 $req = new Request($this->cfg->host, $this->cfg);
45 $req->req->addPostParameter('h', 'entry');
46 $req->req->addPostParameter('content', implode(' ', $cmdRes->args['text']));
47 $req->req->addPostParameter('in-reply-to', $url);
49 $this->handleGenericOptions($cmdRes, $req);
52 $postUrl = $res->getHeader('Location');
53 echo "Reply created at server\n";