function _drush_pm_expand_projects

3.x pm.drush.inc _drush_pm_expand_projects(&$projects, $project_info = array())

Add sub projects that match project_name*.

A helper function for commands that take a space separated list of project names. It will identify project names that have been passed in with a trailing * and add all matching projects to the array that is returned.

Parameters

$projects: An array of projects, by reference.

$project_info: Optional. An array of project info as returned by drush_get_projects().

2 calls to _drush_pm_expand_projects()
drush_pm_classify_projects in commands/pm/pm.drush.inc
Classify projects in modules, themes or unknown ones.
drush_pm_info in commands/pm/pm.drush.inc
Command callback. Show detailed info for one or more projects.

File

commands/pm/pm.drush.inc, line 699
The drush Package Manager

Code

function _drush_pm_expand_projects(&$projects, $project_info = array()) {
  if (empty($project_info)) {
    $project_info = drush_get_projects();
  }
  foreach ($projects as $key => $project) {
    if (($wildcard = rtrim($project, '*')) !== $project) {
      foreach (array_keys($project_info) as $project_name) {
        if (strpos($project_name, $wildcard) !== FALSE) {
          $projects[] = $project_name;
        }
      }
      unset($projects[$key]);
      continue;
    }
  }
}