git.cweiske.de
/
shpub.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Explain that "server" command takes a parameter.
[shpub.git]
/
src
/
shpub
/
Command
/
Article.php
diff --git
a/src/shpub/Command/Article.php
b/src/shpub/Command/Article.php
index 8445af49e7471eab0d803ad81c7fc03e41a37f07..018b4034f75d9dfa25205c767edd251a884912b1 100644
(file)
--- a/
src/shpub/Command/Article.php
+++ b/
src/shpub/Command/Article.php
@@
-6,16
+6,8
@@
class Command_Article extends Command_AbstractProps
public static function opts(\Console_CommandLine $optParser)
{
$cmd = $optParser->addCommand('article');
public static function opts(\Console_CommandLine $optParser)
{
$cmd = $optParser->addCommand('article');
- $cmd->addOption(
- 'html',
- array(
- 'short_name' => '-h',
- 'long_name' => '--html',
- 'description' => 'Text content is HTML',
- 'action' => 'StoreTrue',
- 'default' => false,
- )
- );
+ $cmd->description = 'Create an article';
+ static::addOptHtml($cmd);
static::optsGeneric($cmd);
$cmd->addArgument(
'title',
static::optsGeneric($cmd);
$cmd->addArgument(
'title',
@@
-40,13
+32,7
@@
class Command_Article extends Command_AbstractProps
$req = new Request($this->cfg->host, $this->cfg);
$req->setType('entry');
$req->addProperty('name', $cmdRes->args['title']);
$req = new Request($this->cfg->host, $this->cfg);
$req->setType('entry');
$req->addProperty('name', $cmdRes->args['title']);
- if ($cmdRes->options['html']) {
- $req->addProperty(
- 'content', ['html' => $cmdRes->args['text']]
- );
- } else {
- $req->addProperty('content', $cmdRes->args['text']);
- }
+ $req->addContent($cmdRes->args['text'], $cmdRes->options['html']);
$this->handleGenericOptions($cmdRes, $req);
$res = $req->send();
$this->handleGenericOptions($cmdRes, $req);
$res = $req->send();