function drush_get_command_options_extended

master command.inc drush_get_command_options_extended($command)

Return the list of all of the options for the given command record including options provided by engines and additional-options.

Related topics

1 call to drush_get_command_options_extended()
drush_redispatch_get_options in includes/command.inc
Get the options that were passed to the current command.

File

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

Code

function drush_get_command_options_extended($command) {
  drush_merge_engine_data($command);

  // Start out with just the options in the current command record.
  $options = _drush_get_command_options($command);
  // If 'allow-additional-options' contains a list of command names,
  // then union together all of the options from all of the commands.
  if (is_array($command['allow-additional-options'])) {
    $implemented = drush_get_commands();
    foreach ($command['allow-additional-options'] as $subcommand_name) {
      if (array_key_exists($subcommand_name, $implemented)) {
        $options = array_merge($options, _drush_get_command_options($implemented[$subcommand_name]));
      }
    }
  }
  return $options;
}