function drush_command_set_command_specific

8.0.x command.inc drush_command_set_command_specific($command_default_options, $command = NULL)
6.x command.inc drush_command_set_command_specific($command_default_options, $command = NULL)
7.x command.inc drush_command_set_command_specific($command_default_options, $command = NULL)
5.x command.inc drush_command_set_command_specific($command_default_options, $command = NULL)
master command.inc drush_command_set_command_specific($command_default_options, $command = NULL)
3 calls to drush_command_set_command_specific()
drush_command_default_options in includes/command.inc
Conditionally include default options based on the command used.
drush_command_set_command_specific_options in includes/command.inc
drush_sitealias_command_default_options in includes/command.inc

File

includes/command.inc, line 1643
The drush command engine.

Code

function drush_command_set_command_specific($command_default_options, $command = NULL) {
  if (!$command) {
    $command = drush_get_command();
  }
  if ($command) {
    // Look for command-specific options for this command
    // keyed both on the command's primary name, and on each
    // of its aliases.
    $options_were_set = _drush_command_set_default_options($command_default_options, $command['command']);
    if (isset($command['aliases']) && count($command['aliases'])) {
      foreach ($command['aliases'] as $alias) {
        $options_were_set += _drush_command_set_default_options($command_default_options, $alias);
      }
    }
    // If we set or cleared any options, go back and re-bootstrap any global
    // options such as -y and -v.
    if (!empty($options_were_set)) {
      _drush_preflight_global_options();
    }
    // If the command uses strict option handling, back out any global
    // options that were set.
    if ($command['strict-option-handling']) {
      $global_options = drush_get_global_options();
      foreach ($options_were_set as $key) {
        if (array_key_exists($key, $global_options)) {
          if (!array_key_exists('context', $global_options[$key])) {
            $strict_options_warning = &drush_get_context('DRUSH_STRICT_OPTIONS_WARNING', array());
            if (!array_key_exists($key, $strict_options_warning)) {
              drush_log(dt("Global option --!option not supported in command-specific options for command !command due to a limitation in strict option handling.", array('!option' => $key, '!command' => $command['command'])), LogLevel::WARNING);
              $strict_options_warning[$key] = TRUE;
            }
          }
          drush_unset_option($key, 'specific');
        }
      }
    }
  }
}