X-Git-Url: https://git.cweiske.de/shpub.git/blobdiff_plain/f3edeb601556e7741804b0c0bec2711996774bfe..69fec2594f370eeb8a73c83c70dbeb50855fe65d:/src/shpub/Command/Note.php diff --git a/src/shpub/Command/Note.php b/src/shpub/Command/Note.php index 1ea599b..2a911c9 100644 --- a/src/shpub/Command/Note.php +++ b/src/shpub/Command/Note.php @@ -3,19 +3,11 @@ 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'); + $cmd->description = 'Create a note'; + static::addOptHtml($cmd); static::optsGeneric($cmd); $cmd->addArgument( 'text', @@ -30,8 +22,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->addContent($cmdRes->args['text'], $cmdRes->options['html']); $this->handleGenericOptions($cmdRes, $req); $res = $req->send();