X-Git-Url: https://git.cweiske.de/shpub.git/blobdiff_plain/5c5fff50b8e88170cbf6cb51a8158af7caa00b10..702a671539587fc1ad89258e8c3eb5cf006428b4:/src/shpub/Command/Note.php diff --git a/src/shpub/Command/Note.php b/src/shpub/Command/Note.php index 6fb7cec..cc3a5c1 100644 --- a/src/shpub/Command/Note.php +++ b/src/shpub/Command/Note.php @@ -48,6 +48,17 @@ class Command_Note 'default' => null, ) ); + $cmd->addOption( + 'syndication', + array( + 'short_name' => '-s', + 'long_name' => '--syndication', + 'description' => 'Syndication URL(s)', + 'help_name' => 'URL', + 'action' => 'StoreArray', + 'default' => [], + ) + ); $cmd->addOption( 'x', array( @@ -80,10 +91,15 @@ class Command_Note ); } if (count($command->options['categories'])) { - $req->req->addPostParameter( + $req->addPostParameter( 'category', $command->options['categories'] ); } + if (count($command->options['syndication'])) { + $req->addPostParameter( + 'syndication', $command->options['syndication'] + ); + } $files = $command->options['files']; $fileList = $urlList = [ @@ -127,7 +143,7 @@ class Command_Note $n = 0; foreach ($urls as $url) { $req->req->addPostParameter( - $type . '[' . $n++ . ']', reset($urls) + $type . '[' . $n++ . ']', $url ); } } @@ -144,9 +160,16 @@ class Command_Note } if (count($command->options['x'])) { + $postParams = []; foreach ($command->options['x'] as $xproperty) { list($propkey, $propval) = explode('=', $xproperty, 2); - $req->req->addPostParameter($propkey, $propval); + if (!isset($postParams[$propkey] )) { + $postParams[$propkey] = []; + } + $postParams[$propkey][] = $propval; + } + foreach ($postParams as $propkey => $propvals) { + $req->addPostParameter($propkey, $propvals); } }