X-Git-Url: https://git.cweiske.de/shpub.git/blobdiff_plain/d3445ebb4cb61395736733c2e18a5356e71e96cf..a5b93d3ad9c111fac520c1e5a887d4eac43f19b0:/src/shpub/Command/AbstractProps.php diff --git a/src/shpub/Command/AbstractProps.php b/src/shpub/Command/AbstractProps.php index 08dbc97..822fc77 100644 --- a/src/shpub/Command/AbstractProps.php +++ b/src/shpub/Command/AbstractProps.php @@ -6,6 +6,16 @@ namespace shpub; */ class Command_AbstractProps { + /** + * @var Config + */ + protected $cfg; + + public function __construct($cfg) + { + $this->cfg = $cfg; + } + public static function optsGeneric(\Console_CommandLine_Command $cmd) { $cmd->addOption( @@ -23,13 +33,24 @@ class Command_AbstractProps 'files', array( 'short_name' => '-f', - 'long_name' => '--files', + 'long_name' => '--file', 'description' => 'Files or URLs to upload', 'help_name' => 'PATH', 'action' => 'StoreArray', 'default' => [], ) ); + $cmd->addOption( + 'name', + array( + 'short_name' => '-n', + 'long_name' => '--name', + 'description' => 'Post title', + 'help_name' => 'TITLE', + 'action' => 'StoreString', + 'default' => null, + ) + ); $cmd->addOption( 'published', array( @@ -40,6 +61,16 @@ class Command_AbstractProps 'default' => null, ) ); + $cmd->addOption( + 'updated', + array( + 'long_name' => '--updated', + 'description' => 'Update date', + 'help_name' => 'DATE', + 'action' => 'StoreString', + 'default' => null, + ) + ); $cmd->addOption( 'slug', array( @@ -83,11 +114,21 @@ class Command_AbstractProps 'published', $cmdRes->options['published'] ); } + if ($cmdRes->options['updated'] !== null) { + $req->req->addPostParameter( + 'updated', $cmdRes->options['updated'] + ); + } if (count($cmdRes->options['categories'])) { $req->addPostParameter( 'category', $cmdRes->options['categories'] ); } + if ($cmdRes->options['name'] !== null) { + $req->req->addPostParameter( + 'name', $cmdRes->options['name'] + ); + } if ($cmdRes->options['slug'] !== null) { $req->req->addPostParameter( 'slug', $cmdRes->options['slug']