function _drush_sitealias_user_specified_list

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

Return the list of sites (aliases 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/sitealias.drush.inc
Print out the specified site aliases using the format specified.

File

commands/core/sitealias.drush.inc, line 89
Site alias commands.

Code

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

  // Did the user specify --short or --full output?
  $specified_output_style = drush_get_option(array('full', 'short'), FALSE);

  // Iterate over the arguments and convert them to alias records
  if (!empty($specifications)) {
    $site_list = drush_sitealias_resolve_sitespecs($specifications);
    if (!$specified_output_style) {
      drush_set_option('full', TRUE);
    }
  }
  // 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)) {
        unset($site_list[$site_name]);
      }
    }
  }

  return $site_list;
}