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.

1 call 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…

File

includes/sitealias.inc, line 56
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[0])) {
    drush_set_context('DRUSH_TARGET_SITE_ALIAS', $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;
}