* @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3 * @link http://cweiske.de/shpub.htm */ class Command_X extends Command_AbstractProps { public static function opts(\Console_CommandLine $optParser) { $cmd = $optParser->addCommand('x'); $cmd->description = 'Create a custom type'; static::addOptHtml($cmd); static::optsGeneric($cmd); $cmd->addArgument( 'type', [ 'optional' => false, 'multiple' => false, 'description' => 'Microformat object type', ] ); } public function run(\Console_CommandLine_Result $cmdRes) { $req = new Request($this->cfg->host, $this->cfg); $req->setType($cmdRes->args['type']); $this->handleGenericOptions($cmdRes, $req); $res = $req->send(); $postUrl = $res->getHeader('Location'); Log::info('Object created at server'); Log::msg($postUrl); } } ?>