]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pluginhost.php
rework update.php to use getopt; allow --task parameter
[tt-rss.git] / classes / pluginhost.php
index 79544b01b6a7f3378d92e309c6c2cd342dc82f7c..710435ae4b58a7815fd6b2f48a0044172ba08e7d 100644 (file)
@@ -171,7 +171,7 @@ class PluginHost {
        }
 
        function add_command($command, $description, $sender) {
-               $command = "-" . str_replace("-", "_", strtolower($command));
+               $command = str_replace("-", "_", strtolower($command));
 
                $this->commands[$command] = array("description" => $description,
                        "class" => $sender);
@@ -201,7 +201,7 @@ class PluginHost {
 
        function run_commands($args) {
                foreach ($this->get_commands() as $command => $data) {
-                       if (in_array($command, $args)) {
+                       if (isset($args[$command])) {
                                $command = str_replace("-", "", $command);
                                $data["class"]->$command($args);
                        }