add "published" option to notes
authorChristian Weiske <cweiske@cweiske.de>
Thu, 8 Sep 2016 21:00:49 +0000 (23:00 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 8 Sep 2016 21:00:49 +0000 (23:00 +0200)
src/shpub/Command/Note.php

index 4a09b5afce5cd70a084267f9681384666da664bd..d5231a9d62160fa5723d47ec61391273a20cdf2b 100644 (file)
@@ -27,6 +27,16 @@ class Command_Note
                 'default'     => [],
             )
         );
+        $cmd->addOption(
+            'published',
+            array(
+                'long_name'   => '--published',
+                'description' => 'Publish date',
+                'help_name'   => 'DATE',
+                'action'      => 'StoreString',
+                'default'     => null,
+            )
+        );
         $cmd->addArgument(
             'text',
             [
@@ -42,6 +52,11 @@ class Command_Note
         $req = new Request($this->cfg->host, $this->cfg);
         $req->req->addPostParameter('h', 'entry');
         $req->req->addPostParameter('content', $command->args['text']);
+        if ($command->options['published'] !== null) {
+            $req->req->addPostParameter(
+                'published', $command->options['published']
+            );
+        }
 
         $files = $command->options['files'];
         $fileList = [