function drush_get_context_options

8.0.x context.inc drush_get_context_options($option, $flatten = FALSE)
6.x context.inc drush_get_context_options($option, $flatten = FALSE)
7.x context.inc drush_get_context_options($option, $flatten = FALSE)
3.x context.inc drush_get_context_options($option, $flatten = FALSE)
4.x context.inc drush_get_context_options($option, $flatten = FALSE)
5.x context.inc drush_get_context_options($option, $flatten = FALSE)
master context.inc drush_get_context_options($option, $flatten = FALSE)

Get all of the values for an option in every context.

Parameters

option: The name of the option to get

Return value

An array whose key is the context name and value is the specific value for the option in that context.

1 call to drush_get_context_options()

File

includes/context.inc, line 422
The Drush context API implementation.

Code

function drush_get_context_options($option, $flatten = FALSE) {
  $result = array();

  $contexts = drush_context_names();
  foreach ($contexts as $context) {
    $value = _drush_get_option($option, drush_get_context($context));

    if ($value !== null) {
      if ($flatten && is_array($value)) {
        $result = array_merge($value, $result);
      }
      else {
        $result[$context] = $value;
      }
    }
  }

  return $result;
}