From d78790c613a4363aa0566c357c4444e17582dc23 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 8 Sep 2016 23:00:49 +0200 Subject: [PATCH] add "published" option to notes --- src/shpub/Command/Note.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/shpub/Command/Note.php b/src/shpub/Command/Note.php index 4a09b5a..d5231a9 100644 --- a/src/shpub/Command/Note.php +++ b/src/shpub/Command/Note.php @@ -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 = [ -- 2.30.2