function drush_command_include

8.0.x drush_command_include($command)
6.x drush_command_include($command)
7.x drush_command_include($command)
3.x drush_command_include($command)
4.x drush_command_include($command)
5.x drush_command_include($command)
master drush_command_include($command)

Conditionally include files based on the command used.

Steps through each of the currently loaded commandfiles and loads an optional commandfile based on the key.

When a command such as 'pm-enable' is called, this function will find all '' files that are present in each of the commandfile directories.

1 call to drush_command_include()
drush_invoke in includes/
Invoke drush api calls.


includes/, line 606
The drush command engine.


function drush_command_include($command) {
  $parts = explode('-', $command);
  $command = implode(".", array_reverse($parts));

  $commandfiles = drush_commandfile_list();
  $options = array();
  foreach ($commandfiles as $commandfile => $file) {
    $filename = sprintf("%s/", dirname($file), $command);
    if (file_exists($filename)) {
      drush_log(dt('Including !filename', array('!filename' => $filename)), 'bootstrap');
      include_once ($filename);