X-Git-Url: https://git.cweiske.de/stapibas.git/blobdiff_plain/36c92cff442475d3ebeab443470ae34b77d76fd2..8b2a416ad8b446e50b99514ac1547770684c2255:/src/stapibas/Cli.php diff --git a/src/stapibas/Cli.php b/src/stapibas/Cli.php index 52c7143..88a8cc5 100644 --- a/src/stapibas/Cli.php +++ b/src/stapibas/Cli.php @@ -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); } } @@ -75,6 +77,15 @@ class Cli ) { $tasks = array_flip(explode(',', $result->command->options['tasks'])); + //if an ID/url is given, only execute the matching task + if (isset($result->command->options['feed'])) { + $tasks = array('feeds' => 1); + } else if (isset($result->command->options['entry'])) { + $tasks = array('entries' => 1); + } else if (isset($result->command->options['entryurl'])) { + $tasks = array('urls' => 1); + } + if (isset($tasks['feeds'])) { $this->runFeedUpdateFeeds($deps); } @@ -181,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(