You are here

public static function Command::processOptions in Config Importer and Tools 8

Same name and namespace in other branches
  1. 8.2 src/Drush/Command.php \Drupal\config_import\Drush\Command::processOptions()
  2. 8.0 src/Drush/Command.php \Drupal\config_import\Drush\Command::processOptions()

Process a list of options for the current command.

Parameters

array $options: An associative array of options for the current command.

Return value

array Processed options list.

See also

_drush_config_import_get_options()

File

src/Drush/Command.php, line 112

Class

Command
Class Command.

Namespace

Drupal\config_import\Drush

Code

public static function processOptions(array $options) {
  if (!empty($options['type'])) {
    $options['prefix'] = static::getConfigPrefix($options['type']);

    // The "name" option depends on "type" option.
    if (!empty($options['name'])) {
      $options['name'] = $options['prefix'] . $options['name'];

      // The "destination" option depends on both of above.
      if (!empty($options['destination'])) {
        $options['destination'] = static::getDestination($options['destination'], $options['name']);
      }
    }
  }
  return $options;
}