function drush_sitealias_check_arg

8.0.x drush_sitealias_check_arg()
6.x drush_sitealias_check_arg()
7.x drush_sitealias_check_arg()
3.x drush_sitealias_check_arg()
4.x drush_sitealias_check_arg()
5.x drush_sitealias_check_arg()
master 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/
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…


includes/, line 55
The site alias API.


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]);
    // We only need to expand the site specification
    // once, then we are done.
    return TRUE;
  // Return false to indicate that no site alias was specified.
  return FALSE;