? .patch
? drush.sh
? table.patch
? tmp.patch
? tmp.patch.patch
? updatedb.patch
? commands/core/.patch
Index: commands/core/core.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/core/core.drush.inc,v
retrieving revision 1.27
diff -u -F^f -p -r1.27 core.drush.inc
--- commands/core/core.drush.inc	8 May 2009 03:46:15 -0000	1.27
+++ commands/core/core.drush.inc	11 May 2009 17:24:36 -0000
@@ -158,7 +158,7 @@ function drush_core_help() {
             $pipe[] = "\"$key\"";
           }
         }
-        drush_print_table($rows, 2);
+        drush_print_table($rows, 2, TRUE, array('35', '65'));
         $printed_rows = array_merge($printed_rows, $rows);
       }
       else {
Index: includes/drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/includes/drush.inc,v
retrieving revision 1.37
diff -u -F^f -p -r1.37 drush.inc
--- includes/drush.inc	11 May 2009 15:20:16 -0000	1.37
+++ includes/drush.inc	11 May 2009 17:24:36 -0000
@@ -345,7 +345,7 @@ function drush_show_help($commands) {
                 // '[command] is a token representing the current command. @see pm_drush_engine_version_control().
                 $rows[] = array(str_replace('[command]', $commandstring, $name), dt($description));
               }
-              drush_print_table($rows, 2);
+              drush_print_table($rows, 2, FALSE, array('35', '65'));
               unset($rows);
               drush_print();
             }
@@ -482,6 +482,35 @@ function drush_confirm($msg, $indent = 0
   }
 }
 
+function drush_print_table_console($rows, $indent = 0, $header = FALSE, $widths = array()) {    
+  $tbl = new Console_Table(CONSOLE_TABLE_ALIGN_LEFT , '');
+  if ($header) {
+    $headers = array_shift($rows);
+    $tbl->setHeaders($headers);
+  }
+  
+  // Calculate width of each column if not supplied. Assume all are even.
+  $row_first = current($rows);
+  if ($rows && empty($widths)) {
+    $width = round(100 / count($row_first), 0);
+    $widths = array_fill(0, count($row_first), $width);
+  }
+  // Do wordwrap on all cells.
+  $i = $j = 0;
+  foreach ($rows as $rowkey => $row) {
+    foreach ($row as $cellkey => $cell) {
+      $cellwidth = $widths[$j]*.01*(drush_get_context('DRUSH_COLUMNS', 80)-3);
+      $newrows[$rowkey][$cellkey] = wordwrap($cell, $cellwidth);
+      $j++;
+    }
+    $j=0;
+    $i++;
+  }
+   
+  $tbl->addData($newrows);
+  return $tbl->getTable();
+}
+
 /**
  * Print a formatted table.
  * @param $rows
@@ -491,28 +520,36 @@ function drush_confirm($msg, $indent = 0
  * @param $header
  *   If TRUE, the first line will be treated as table
  *   header and therefore be underlined.
+ * @param $widths
+ *   An array of percentages for each column width.
  */
-function drush_print_table($rows, $indent = 0, $header = FALSE) {
+function drush_print_table($rows, $indent = 0, $header = FALSE, $widths = array()) {
   if (count($rows) == 0) {
     // Nothing to output.
     return;
   }
-
-  $indent = str_repeat(' ', $indent);
-  $format = _drush_get_table_row_format($rows);
-
-  $header_printed = FALSE;
-  foreach ($rows as $cols) {
-    // Print the current line.
-    print $indent . vsprintf($format, $cols) . "\n";
-    // Underline the first row if $header is set to true.
-    if (!$header_printed && $header) {
-      $headers = array();
-      foreach ($cols as $col) {
-        $headers[] = str_repeat('-', strlen($col));
+  
+  include_once 'Console/Table.php';
+  if (class_exists('Console_Table')) {
+    print drush_print_table_console($rows, $indent, $header, $widths);
+  }
+  else {
+    $indent = str_repeat(' ', $indent);
+    $format = _drush_get_table_row_format($rows);
+
+    $header_printed = FALSE;
+    foreach ($rows as $cols) {
+      // Print the current line.
+      print $indent . vsprintf($format, $cols) . "\n";
+      // Underline the first row if $header is set to true.
+      if (!$header_printed && $header) {
+        $headers = array();
+        foreach ($cols as $col) {
+          $headers[] = str_repeat('-', strlen($col));
+        }
+        print $indent . trim(vsprintf($format, $headers)) . "\n";
+        $header_printed = TRUE;
       }
-      print $indent . trim(vsprintf($format, $headers)) . "\n";
-      $header_printed = TRUE;
     }
   }
 }
