function drush_sitealias_check_arg

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

Check to see if the first command-line arg or the -l option is a site alias; if it is, copy its record values to the 'alias' context.

Return value

boolean TRUE if a site alias was found and processed.

2 calls to drush_sitealias_check_arg()
_drush_bootstrap_drush in includes/environment.inc
Initial Drush bootstrap phase.
_drush_bootstrap_redo_drupal_site in includes/environment.inc
Re-do the drupal site bootstrap (and possibly the drupal root bootstrap) if a site alias was processed after the site bootstrap phase completed. This will happen when processing "drush sitealias command" for a site alias defined in a…

File

includes/sitealias.inc, line 20
The site alias API.

Code

function drush_sitealias_check_arg() {
  $args = drush_get_arguments();

  // Test to see if the first arg is a site specification
  if (_drush_sitealias_set_context_by_name($args[0])) {
    array_shift($args);
    // We only need to expand the site specification
    // once, then we are done.
    drush_set_arguments($args);
    return TRUE;
  }

  // Return false to indicate that no site alias was specified.
  return FALSE;
}