function _drush_pm_expand_projects

3.x _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.


$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/
Classify projects in modules, themes or unknown ones.
drush_pm_info in commands/pm/
Command callback. Show detailed info for one or more projects.


commands/pm/, line 699
The drush Package Manager


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;