function _drush_sitealias_user_specified_list

8.0.x _drush_sitealias_user_specified_list()
6.x _drush_sitealias_user_specified_list()
7.x _drush_sitealias_user_specified_list()
3.x _drush_sitealias_user_specified_list()
4.x _drush_sitealias_user_specified_list()
5.x _drush_sitealias_user_specified_list()
master _drush_sitealias_user_specified_list()

Return the list of site aliases (remote or local) that the user specified on the command line. If none were specified, then all are returned.

1 call to _drush_sitealias_user_specified_list()
drush_sitealias_print in commands/core/
Print out the specified site aliases (or else all) using the format specified.


commands/core/, line 139
Site alias commands.


function _drush_sitealias_user_specified_list() {
  $command = drush_get_command();
  $specifications = $command['arguments'];
  $site_list = array();

  // Iterate over the arguments and convert them to alias records
  if (!empty($specifications)) {
    list($site_list, $not_found) = drush_sitealias_resolve_sitespecs($specifications);
    if (!empty($not_found)) {
      return drush_set_error('DRUSH_ALIAS_NOT_FOUND', dt("Not found: @list", array("@list" => implode(', ', $not_found))));
  // If the user provided no args, then we will return everything.
  else {
    $site_list = _drush_sitealias_all_list();

    // Filter out the hidden items
    foreach ($site_list as $site_name => $one_site) {
      if (array_key_exists('#hidden', $one_site)) {

  // Filter for only local sites if specified.
  if (drush_get_option('local-only', FALSE)) {
    foreach ($site_list as $site_name => $one_site) {
      if ((array_key_exists('remote-site', $one_site)) || (!array_key_exists('root', $one_site)) || (!is_dir($one_site['root']))) {
  return $site_list;