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 6d7ef3b..b560fbe 100644 (file)
@@ -41,6 +41,17 @@ class Command_AbstractProps
             )
         );
         $cmd->addOption(
+            'name',
+            array(
+                'short_name'  => '-n',
+                'long_name'   => '--name',
+                'description' => 'Post title',
+                'help_name'   => 'TITLE',
+                'action'      => 'StoreString',
+                'default'     => null,
+            )
+        );
+        $cmd->addOption(
             'published',
             array(
                 'long_name'   => '--published',
@@ -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']