From 24ec74fd0573cab3c6909e49c046e139f8923307 Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel Date: Wed, 29 Dec 2010 11:03:58 +0100 Subject: [PATCH] Rename the 'folders' action to 'list'. Add 'type' subaction (lists all folders of a specific type). --- .../Kolab/Cli/Module/{Folder.php => List.php} | 40 +++++++++++++++++----- framework/Kolab_Cli/package.xml | 14 +++++--- 2 files changed, 40 insertions(+), 14 deletions(-) rename framework/Kolab_Cli/lib/Horde/Kolab/Cli/Module/{Folder.php => List.php} (76%) diff --git a/framework/Kolab_Cli/lib/Horde/Kolab/Cli/Module/Folder.php b/framework/Kolab_Cli/lib/Horde/Kolab/Cli/Module/List.php similarity index 76% rename from framework/Kolab_Cli/lib/Horde/Kolab/Cli/Module/Folder.php rename to framework/Kolab_Cli/lib/Horde/Kolab/Cli/Module/List.php index 750d8a535..9c68f5a4a 100644 --- a/framework/Kolab_Cli/lib/Horde/Kolab/Cli/Module/Folder.php +++ b/framework/Kolab_Cli/lib/Horde/Kolab/Cli/Module/List.php @@ -1,7 +1,6 @@ _getStorage($options)->getList()->listFolders(); foreach ($folders as $folder) { $cli->writeln($folder); } break; + case 'types': + $types = $this->_getStorage($options)->getList()->listTypes(); + if (!empty($types)) { + $pad = max(array_map('strlen', array_keys($types))) + 2; + foreach ($types as $folder => $type) { + $cli->writeln(Horde_String::pad($folder . ':', $pad) . $type); + } + } + break; + case 'type': + if (!isset($arguments[2])) { + throw new Horde_Kolab_Cli_Exception('You must provide a TYPE argument!'); + } + $type = $arguments[2]; + $folders = $this->_getStorage($options) + ->getList() + ->getQuery('Base') + ->listByType($type); + foreach ($folders as $folder) { + $cli->writeln($folder); + } + break; case 'show': if (!isset($arguments[2])) { $folder_name = 'INBOX'; diff --git a/framework/Kolab_Cli/package.xml b/framework/Kolab_Cli/package.xml index 62ff61fda..4c364a25a 100644 --- a/framework/Kolab_Cli/package.xml +++ b/framework/Kolab_Cli/package.xml @@ -22,8 +22,8 @@ jan@horde.org yes - 2010-12-21 - + 2010-12-29 + 0.0.1 0.0.1 @@ -47,7 +47,7 @@ - + @@ -104,6 +104,10 @@ pear.horde.org + Util + pear.horde.org + + Log pear.horde.org @@ -116,7 +120,7 @@ - + @@ -138,7 +142,7 @@ alpha alpha - 2010-12-21 + 2010-12-29 GPL * Initial release. -- 2.11.0