You are here

function drush_migrate_get_options in Migrate 6.2

Same name and namespace in other branches
  1. 6 migrate.drush.inc \drush_migrate_get_options()
  2. 7.2 migrate.drush.inc \drush_migrate_get_options()

Get the value of all migrate related options. Used when spawning a subshell. Don't pass along all, stop, update, and rollback options.

Return value

An array of command specific options and their values.

1 call to drush_migrate_get_options()
drush_migrate_invoke_process in ./migrate.drush.inc

File

./migrate.drush.inc, line 237
Drush support for the migrate module

Code

function drush_migrate_get_options() {
  $options = array();
  $blacklist = array(
    'stop',
    'rollback',
    'update',
    'all',
  );
  $command = drush_parse_command();
  foreach ($command['options'] as $key => $value) {

    // Strip leading --
    $key = ltrim($key, '-');
    if (!in_array($key, $blacklist)) {
      $value = drush_get_option($key);
      if (isset($value)) {
        $options[$key] = $value;
      }
    }
  }
  return $options;
}