? .svn
? drushrc.php
? simple_load_check.diff
? update_status
? z
? commands/core/batch.drush.inc
? includes/table.inc
Index: includes/command.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/includes/command.inc,v
retrieving revision 1.63
diff -u -r1.63 command.inc
--- includes/command.inc	25 Jan 2010 02:35:13 -0000	1.63
+++ includes/command.inc	25 Jan 2010 21:33:01 -0000
@@ -475,6 +475,8 @@
 function _drush_find_commandfiles($phase) {
   $cache =& drush_get_context('DRUSH_COMMAND_FILES', array());
 
+  static $evaluated = array();
+
   $searchpath = array();
   switch ($phase) {
     case DRUSH_BOOTSTRAP_DRUSH:
@@ -529,10 +531,23 @@
         $files = drush_scan_directory($path, '/\.drush\.inc$/');
         foreach ($files as $filename => $info) {
           $module = basename($filename, '.drush.inc');
-          // We check both arrays because we may be called multiple times with different bootstrap levels
-          if (!array_key_exists($module, $cache) && !array_key_exists($module, $list)) {
-            require_once(realpath($filename));
-            $list[$module] = $filename;
+          if (!array_key_exists($module, $evaluated)) {
+            $evaluated[$module] = TRUE;
+
+            $load_command = TRUE;
+
+            $file = dirname($filename) . "/" . $module . ".drush.load.inc";
+            if (file_exists($file)) {
+              require_once($file);
+              $func = $module . "_drush_load";
+              if (function_exists($module . "_drush_load")) {
+                $load_command = $func();
+              }
+            }
+            if ($load_command) {
+              require_once(realpath($filename));
+              $list[$module] = $filename;
+            }
           }
         }
       }
