function _drush_get_option

8.0.x _drush_get_option($option, $context)
6.x _drush_get_option($option, $context)
7.x _drush_get_option($option, $context)
3.x _drush_get_option($option, $context)
4.x _drush_get_option($option, $context)
5.x _drush_get_option($option, $context)
master _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/
Get all of the values for an option in every context.
drush_get_option in includes/
Get the value for an option.


includes/, line 562
The Drush context API implementation.


function _drush_get_option($option, $context) {
  if (is_array($option)) {
    foreach ($option as $current) {
      $current_value = _drush_get_option($current, $context);
      if (isset($current_value)) {
        return $current_value;
  elseif (array_key_exists('no-' . $option, $context)) {
    return FALSE;
  elseif (array_key_exists($option, $context)) {
    return $context[$option];

  return NULL;