function _drush_get_option

8.0.x context.inc _drush_get_option($option, $context)
6.x context.inc _drush_get_option($option, $context)
7.x context.inc _drush_get_option($option, $context)
3.x context.inc _drush_get_option($option, $context)
4.x context.inc _drush_get_option($option, $context)
5.x context.inc _drush_get_option($option, $context)
master context.inc _drush_get_option($option, $context)

Helper function to recurse through possible option names

2 calls to _drush_get_option()
drush_get_context_options in includes/context.inc
Get all of the values for an option in every context.
drush_get_option in includes/context.inc
Get the value for an option.

File

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

Code

function _drush_get_option($option, $context) {
  if (is_array($option)) {
    foreach ($option as $current) {
      if (array_key_exists($current, $context)) {
        return $context[$current];
      }
    }
  }
  elseif (array_key_exists($option, $context)) {
    return $context[$option];
  }

  return NULL;
}