X-Git-Url: https://git.cweiske.de/shpub.git/blobdiff_plain/ff8573f63f912d05426b6928364146d1c7794f99..6c791f2d0c159d56c570802c8d9bd3612262aa9e:/src/shpub/Command/Undelete.php diff --git a/src/shpub/Command/Undelete.php b/src/shpub/Command/Undelete.php index ad3525f..63d604b 100644 --- a/src/shpub/Command/Undelete.php +++ b/src/shpub/Command/Undelete.php @@ -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');