function _drush_pm_expand_extensions

8.0.x _drush_pm_expand_extensions(&$extensions, $extension_info = array())
6.x _drush_pm_expand_extensions(&$extensions, $extension_info = array())
7.x _drush_pm_expand_extensions(&$extensions, $extension_info = array())
4.x _drush_pm_expand_extensions(&$extensions, $extension_info = array())
5.x _drush_pm_expand_extensions(&$extensions, $extension_info = array())
master _drush_pm_expand_extensions(&$extensions, $extension_info = array())

Add extensions that match extension_name*.

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


$extensions: An array of extensions, by reference.

$extension_info: Optional. An array of extension info as returned by drush_get_extensions().

2 calls to _drush_pm_expand_extensions()
drush_pm_classify_extensions in commands/pm/
Classify extensions as modules, themes or unknown.
drush_pm_info in commands/pm/
Command callback. Show detailed info for one or more extensions.


commands/pm/, line 1169
The drush Project Manager


function _drush_pm_expand_extensions(&$extensions, $extension_info = array()) {
  if (empty($extension_info)) {
    $extension_info = drush_get_extensions();
  foreach ($extensions as $key => $extension) {
    if (($wildcard = rtrim($extension, '*')) !== $extension) {
      foreach (array_keys($extension_info) as $extension_name) {
        if (substr($extension_name, 0, strlen($wildcard)) == $wildcard) {
          $extensions[] = $extension_name;