add "category" option to notes
[shpub.git] / src / shpub / Command / Note.php
index b5df8ba6fe001a1f17353b2d1df672b82c135a12..aceffcfb1e6ffc34cc46c6a74879d8f96db3230d 100644 (file)
@@ -16,6 +16,17 @@ class Command_Note
     public static function opts(\Console_CommandLine $optParser)
     {
         $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(
@@ -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 = [