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_complete_process_argv in includes/complete.inc
This function resets the raw arguments so that Drush can parse the command as if it was run directly. The shell complete command passes the full command line as an argument, and the --early and --complete-debug options have to come before that, and…
_drush_bootstrap_drush in includes/bootstrap.inc
Initial Drush bootstrap phase.

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 (!empty($args) && _drush_sitealias_set_context_by_name($args[])) {
    drush_set_context('DRUSH_TARGET_SITE_ALIAS', $args[]);
    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;
}