add feed/list command, show help when no feed command given
[stapibas.git] / src / stapibas / Cli.php
index 40d9d17b9612e4d87fe9f0187eedd07a562edba2..88a8cc5644f639be1ac64563ab121563ad608719 100644 (file)
@@ -63,10 +63,12 @@ class Cli
         $mg = new Feed_Manage($deps);
         if ($command->command_name == 'add') {
             $mg->addFeed($command->command->args['feed']);
-        } else if ($command->command_name ==  'remove') {
+        } else if ($command->command_name == 'remove') {
             $mg->removeFeed($command->command->args['feed']);
-        } else {
+        } else if ($command->command_name == 'list') {
             $mg->listAll();
+        } else {
+            $this->cliParser->commands['feed']->displayUsage(1);
         }
     }
 
@@ -190,6 +192,13 @@ class Cli
         );
         $add->addArgument('feed', array('description' => 'URL of feed'));
 
+        $feed->addCommand(
+            'list',
+            array(
+                'description' => 'List all feeds',
+            )
+        );
+
         $remove = $feed->addCommand(
             'remove',
             array(