support image urls
[shpub.git] / src / shpub / Command / Like.php
index 26f615a163e8d5e2f7643a71e866b58d70d1c441..e7c6052fc6866b458b01a820f7dd7a03bdc845ad 100644 (file)
@@ -13,9 +13,21 @@ class Command_Like
         $this->cfg = $cfg;
     }
 
-    public function run($url)
+    public static function opts(\Console_CommandLine $optParser)
     {
-        $url = Validator::url($url, 'url');
+        $cmd = $optParser->addCommand('like');
+        $cmd->addArgument(
+            'url',
+            [
+                'optional'    => false,
+                'description' => 'URL that is liked',
+            ]
+        );
+    }
+
+    public function run($command)
+    {
+        $url = Validator::url($command->args['url'], 'url');
         if ($url === false) {
             exit(10);
         }