add description for all commands
[shpub.git] / src / shpub / Command / Undelete.php
index ad3525f90bace44582be6521ba22f4f05e910149..63d604b6c22515162ea902986c7751860fc1e52f 100644 (file)
@@ -6,6 +6,8 @@ class Command_Undelete extends Command_AbstractProps
     public static function opts(\Console_CommandLine $optParser)
     {
         $cmd = $optParser->addCommand('undelete');
+        $cmd->description = 'Restore a deleted post';
+        static::addOptJson($cmd);
         $cmd->addArgument(
             'url',
             [
@@ -23,8 +25,9 @@ class Command_Undelete extends Command_AbstractProps
         }
 
         $req = new Request($this->cfg->host, $this->cfg);
-        $req->req->addPostParameter('action', 'undelete');
-        $req->req->addPostParameter('url', $url);
+        $this->handleOptJson($cmdRes, $req);
+        $req->setAction('undelete');
+        $req->setUrl($url);
 
         $res = $req->send();
         Log::info('Post restored at server');