You are here

protected function WebformCliService::_drush_get_options in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Commands/WebformCliService.php \Drupal\webform\Commands\WebformCliService::_drush_get_options()

Get drush command options with dashed converted to underscores.

Parameters

array $default_options: The commands default options

Return value

array An associative array of options.

1 call to WebformCliService::_drush_get_options()
WebformCliService::drush_webform_import in src/Commands/WebformCliService.php

File

src/Commands/WebformCliService.php, line 1518

Class

WebformCliService
Drush version agnostic commands.

Namespace

Drupal\webform\Commands

Code

protected function _drush_get_options(array $default_options) {
  $options = $this
    ->drush_redispatch_get_options();

  // Convert dashes to underscores.
  foreach ($options as $key => $value) {
    unset($options[$key]);
    if (isset($default_options[$key]) && is_array($default_options[$key])) {
      $value = explode(',', $value);
    }
    $options[str_replace('-', '_', $key)] = $value;
  }
  $options += $default_options;
  return $options;
}