? 864376-libraries-external-20.patch ? 919632-libraries-info-file-10.patch ? libraries_drush_list.patch ? review-me.patch Index: libraries.drush.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/libraries/libraries.drush.inc,v retrieving revision 1.1 diff -u -p -r1.1 libraries.drush.inc --- libraries.drush.inc 19 Aug 2010 00:06:41 -0000 1.1 +++ libraries.drush.inc 9 Oct 2010 23:22:49 -0000 @@ -10,18 +10,18 @@ * Implements hook_drush_command(). */ function libraries_drush_command() { - return; $items['libraries-list'] = array( 'callback' => 'libraries_drush_list', 'description' => dt('Lists registered library information.'), + 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, ); - $items['libraries-download'] = array( + /**$items['libraries-download'] = array( 'callback' => 'libraries_drush_download', 'description' => dt('Downloads a registered library into the libraries directory for the active site.'), 'arguments' => array( 'name' => dt('The internal name of the registered library.'), ), - ); + );*/ return $items; } @@ -41,6 +41,46 @@ See libraries-list for a list of registe } /** + * Lists registered library information. + */ +function libraries_drush_list() { + $libraries = libraries_detect(libraries_info()); + ksort($libraries); + + if (empty($libraries)) { + drush_print('There are no registered libraries.'); + } + + else { + $header = array('Name', 'Title', 'Version', 'Status'); + $rows = array(); + foreach ($libraries as $name => $info) { + $version = $info['version']; + if ($info['installed']) { + $status = 'Installed'; + } + else { + switch ($info['error']) { + case t('%library could not be found.', array('%library' => $info['title'])): + $status = 'Not found'; + break; + case t('The version of %library could not be detected.', array('%library' => $info['title'])): + $version = 'Undetected'; + $status = 'Not installed'; + break; + case t('The installed version %version of %library is not supported.', array('%version' => $info['version'], '%library' => $info['title'])): + $status = 'Unsupported version'; + break; + } + } + $rows[] = array($name, $info['title'], $version, $status); + } + $table = new Console_Table(); + drush_print($table->fromArray($header, $rows)); + } +} + +/** * Downloads a library. * * @param $name