add "category" option to notes
authorChristian Weiske <cweiske@cweiske.de>
Mon, 12 Sep 2016 04:31:06 +0000 (06:31 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Mon, 12 Sep 2016 04:31:06 +0000 (06:31 +0200)
src/shpub/Command/Note.php

index b5df8ba..aceffcf 100644 (file)
@@ -17,6 +17,17 @@ class Command_Note
     {
         $cmd = $optParser->addCommand('note');
         $cmd->addOption(
+            'categories',
+            array(
+                'short_name'  => '-c',
+                'long_name'   => '--category',
+                'description' => 'Categories',
+                'help_name'   => 'CAT',
+                'action'      => 'StoreArray',
+                'default'     => [],
+            )
+        );
+        $cmd->addOption(
             'files',
             array(
                 'short_name'  => '-f',
@@ -57,6 +68,11 @@ class Command_Note
                 'published', $command->options['published']
             );
         }
+        if (count($command->options['categories'])) {
+            $req->req->addPostParameter(
+                'category', $command->options['categories']
+            );
+        }
 
         $files = $command->options['files'];
         $fileList = $urlList = [