Add "json" option
[shpub.git] / src / shpub / Command / Note.php
index 1ea599b57e847386d596ee149513e8fde61d5bd7..c7683f3b7a289f5052e571b2e3754b0ba6e77db7 100644 (file)
@@ -3,16 +3,6 @@ namespace shpub;
 
 class Command_Note extends Command_AbstractProps
 {
-    /**
-     * @var Config
-     */
-    protected $cfg;
-
-    public function __construct($cfg)
-    {
-        $this->cfg = $cfg;
-    }
-
     public static function opts(\Console_CommandLine $optParser)
     {
         $cmd = $optParser->addCommand('note');
@@ -30,8 +20,8 @@ class Command_Note extends Command_AbstractProps
     public function run(\Console_CommandLine_Result $cmdRes)
     {
         $req = new Request($this->cfg->host, $this->cfg);
-        $req->req->addPostParameter('h', 'entry');
-        $req->req->addPostParameter('content', $cmdRes->args['text']);
+        $req->setType('entry');
+        $req->addProperty('content', $cmdRes->args['text']);
         $this->handleGenericOptions($cmdRes, $req);
 
         $res = $req->send();