'default' => null,
)
);
+ $cmd->addOption(
+ 'x',
+ array(
+ 'short_name' => '-x',
+ 'long_name' => '--xprop',
+ 'description' => 'Additional property',
+ 'help_name' => 'key=value',
+ 'action' => 'StoreArray',
+ 'default' => [],
+ )
+ );
$cmd->addArgument(
'text',
[
}
}
+ if (count($command->options['x'])) {
+ foreach ($command->options['x'] as $xproperty) {
+ list($propkey, $propval) = explode('=', $xproperty, 2);
+ $req->req->addPostParameter($propkey, $propval);
+ }
+ }
+
$res = $req->send();
$postUrl = $res->getHeader('Location');
echo "Post created at server\n";