function sitealias_drush_command

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

File

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

Code

function sitealias_drush_command() {
  $items = array();

  $items['site-alias'] = array(
    'callback' => 'drush_sitealias_print',
    'description' => 'Print site alias records for all known site aliases and local sites.',
    'bootstrap' => DRUSH_BOOTSTRAP_NONE,
    'arguments' => array(
      'site' => 'Site specification to print',
    ),
    'options' => array(
      'with-db' => 'Include the databases structure in the full alias record.',
      'with-db-url' => 'Include the short-form db-url in the full alias record.',
      'no-db' => 'Do not include the database record in the full alias record (default).',
      'with-optional' => 'Include optional default items.',
      'alias-name' => 'For a single alias, set the name to use in the output.',
      'local-only' => 'Only display sites that are available on the local system (remote-site not set, and Drupal root exists).',
      'show-hidden' => 'Include hidden internal elements in site alias output',
    ),
    'outputformat' => array(
      'default' => 'config',
      'pipe-format' => 'var_export',
      'variable-name' => 'aliases',
      'hide-empty-fields' => TRUE,
      'private-fields' => 'password',
      'field-labels' => array(
        '#name' => 'Name',
        'root' => 'Root',
        'uri' => 'URI',
        'remote-host' => 'Host',
        'remote-user' => 'User',
        'remote-port' => 'Port',
        'os' => 'OS',
        'ssh-options' => 'SSH options',
        'php' => 'PHP',
      ),
      'fields-default' => array(
        '#name',
        'root',
        'uri',
        'remote-host',
        'remote-user',
      ),
      'field-mappings' => array('name' => '#name'),
      'output-data-type' => 'format-table',
    ),
    'aliases' => array('sa'),
    'examples' => array(
      'drush site-alias' => 'List all alias records known to drush.',
      'drush site-alias @dev' => 'Print an alias record for the alias \'dev\'.',
      'drush @none site-alias' => 'Print only actual aliases; omit multisites from the local Drupal installation.',
    ),
    'topics' => array('docs-aliases'),
  );
  $items['site-set'] = array(
    'description' => 'Set a site alias to work on that will persist for the current session.',
    'bootstrap' => DRUSH_BOOTSTRAP_NONE,
    'handle-remote-commands' => TRUE,
    'arguments' => array(
      'site' => 'Site specification to use, or "-" for previous site. Omit this argument to "unset"',
    ),
    'aliases' => array('use'),
    'examples' => array(
      'drush site-set @dev' => 'Set the current session to use the @dev alias.',
      'drush site-set user@server/path/to/drupal#sitename' => 'Set the current session to use a site specification.',
      'drush site-set -' => 'Go back to the previously-set site (like `cd -`).',
      'drush site-set' => 'Without an argument, any existing site becomes unset.',
    ),
  );
  return $items;
}