make user URL optional in connect command
[shpub.git] / src / shpub / Cli.php
index a57b287fda084518f5f47f2066105507be58a45b..34ef479ad94def40867c123e0a6524cf4fe0e497 100644 (file)
@@ -27,15 +27,27 @@ class Cli
                     $res->command->options['force']
                 );
                 break;
+
+            case 'server':
+                $cmd = new Command_Server($this->cfg);
+                $cmd->run($res->command->options['verbose']);
+                break;
+
             case 'like':
                 $this->requireValidHost();
                 $cmd = new Command_Like($this->cfg->host);
                 $cmd->run($res->command->args['url']);
                 break;
-            case 'server':
-                $cmd = new Command_Server($this->cfg);
-                $cmd->run($res->command->options['verbose']);
+
+            case 'reply':
+                $this->requireValidHost();
+                $cmd = new Command_Reply($this->cfg->host);
+                $cmd->run(
+                    $res->command->args['url'],
+                    implode(' ', $res->command->args['text'])
+                );
                 break;
+
             default:
                 var_dump($this->cfg->host, $res);
                 Log::err('FIXME');
@@ -134,7 +146,7 @@ class Cli
         $cmd->addArgument(
             'user',
             [
-                'optional'    => false,
+                'optional'    => true,
                 'description' => 'User URL',
             ]
         );
@@ -171,6 +183,7 @@ class Cli
             'text',
             [
                 'optional'    => false,
+                'multiple'    => true,
                 'description' => 'Reply text',
             ]
         );