function drush_core_config

8.0.x core.drush.inc drush_core_config($filter = NULL)
6.x core.drush.inc drush_core_config($filter = NULL)
7.x core.drush.inc drush_core_config($filter = NULL)
5.x core.drush.inc drush_core_config($filter = NULL)
master core.drush.inc drush_core_config($filter = NULL)

Command callback. Edit drushrc and alias files.

File

commands/core/core.drush.inc, line 675
Core drush commands.

Code

function drush_core_config($filter = NULL) {
  $all = drush_core_config_load();

  // Apply any filter that was supplied.
  if ($filter) {
    foreach ($all as $key => $file) {
      if (strpos($file, $filter) === FALSE) {
        unset($all[$key]);
      }
    }
  }
  $all = drush_map_assoc(array_values($all));

  $exec = drush_get_editor();
  if (count($all) == 1) {
    $filepath = current($all);
  }
  else {
    $choice = drush_choice($all, 'Enter a number to choose which file to edit.', '!key');
    if (!$choice) {
      return drush_user_abort();
    }
    $filepath = $all[$choice];
  }
  return drush_shell_exec_interactive($exec, $filepath, $filepath);
}