diff --git a/features.drush.inc b/features.drush.inc index 4cec62e..ba0c830 100644 --- a/features.drush.inc +++ b/features.drush.inc @@ -30,6 +30,10 @@ function features_drush_command() { 'options' => array( 'status' => "Feature status, can be 'enabled', 'disabled' or 'all'", ), + 'outputformat' => array( + 'default' => 'table', + 'pipe-format' => 'csv', + ), 'drupal dependencies' => array('features'), 'aliases' => array('fl', 'features'), ); @@ -37,7 +41,7 @@ function features_drush_command() { 'description' => "Export a feature from your site into a module.", 'arguments' => array( 'feature' => 'Feature name to export.', - 'components' => 'Patterns of components to include, see features-components for the format of patterns.' + 'components' => 'Patterns of components to include, see features-components for the format of patterns.', ), 'options' => array( 'destination' => "Destination path (from Drupal root) of the exported feature. Defaults to '" . $path . "'.", @@ -207,39 +211,43 @@ function drush_features_list() { } module_load_include('inc', 'features', 'features.export'); - $rows = array(array(dt('Name'), dt('Feature'), dt('Status'), dt('Version'), dt('State'))); // Sort the Features list before compiling the output. $features = features_get_features(NULL, TRUE); ksort($features); - foreach ($features as $k => $m) { - switch (features_get_storage($m->name)) { + foreach ($features as $key => $module) { + switch (features_get_storage($module->name)) { case FEATURES_DEFAULT: case FEATURES_REBUILDABLE: - $storage = ''; + $state = ''; break; + case FEATURES_OVERRIDDEN: - $storage = dt('Overridden'); + $state = dt('Overridden'); break; + case FEATURES_NEEDS_REVIEW: - $storage = dt('Needs review'); + $state = dt('Needs review'); break; } if ( - ($m->status == 0 && ($status == 'all' || $status == 'disabled')) || - ($m->status == 1 && ($status == 'all' || $status == 'enabled')) + ($module->status == 0 && ($status == 'all' || $status == 'disabled')) || + ($module->status == 1 && ($status == 'all' || $status == 'enabled')) ) { - $rows[] = array( - $m->info['name'], - $m->name, - $m->status ? dt('Enabled') : dt('Disabled'), - $m->info['version'], - $storage + $row = array( + dt('Name') => $module->info['name'], + dt('Feature') => $module->name, + dt('Status') => $module->status ? dt('Enabled') : dt('Disabled'), + dt('Version') => $module->info['version'], + dt('State') => $state, ); + + $rows[] = $row; } } - drush_print_table($rows, TRUE); + + return $rows; } /**