Add "name" option for post titles
authorChristian Weiske <cweiske@cweiske.de>
Thu, 15 Sep 2016 05:47:32 +0000 (07:47 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 15 Sep 2016 05:47:32 +0000 (07:47 +0200)
src/shpub/Command/AbstractProps.php

index 6d7ef3b8c27c346ca87f0cff8feedafbe56a70ea..b560fbefa45fcce9563ef46353eada8e74ebebb0 100644 (file)
@@ -40,6 +40,17 @@ class Command_AbstractProps
                 '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(
@@ -98,6 +109,11 @@ class Command_AbstractProps
                 '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']