You are here

function environment_drush_command in Environment 8

Same name and namespace in other branches
  1. 6 environment.drush.inc \environment_drush_command()
  2. 7 environment.drush.inc \environment_drush_command()

Implements hook_drush_command().

File

./environment.drush.inc, line 10
Executes the environment_switch capabilities.

Code

function environment_drush_command() {
  $items = array();
  $items['environment-list'] = array(
    'description' => 'Show all environments.',
    'drupal dependencies' => array(
      'environment',
    ),
    'aliases' => array(
      'env-list',
    ),
  );
  $items['environment-current'] = array(
    'description' => 'Show the current environment state.',
    'drupal dependencies' => array(
      'environment',
    ),
    'aliases' => array(
      'env',
      'env-current',
      'environment',
    ),
  );
  $items['environment-switch'] = array(
    'description' => 'Switch the environment to specified state.',
    'drupal dependencies' => array(
      'environment',
    ),
    'arguments' => array(
      'target_env' => 'The target environment to which the site will be switched.',
    ),
    'options' => array(
      'force' => 'Whether an environment switch should be forced if the target enviornment is the same as the current environment.',
      'nocacheclear' => 'Switching environments clears the cache by default, this stops that.',
    ),
    'examples' => array(
      'drush environment-switch development' => 'Switch the environment to development.',
      'drush env-switch --force production' => 'Force the environment to switch to production even if the current environment already is production.',
      'drush env-switch --nocacheclear production' => 'Switch environments but do not clear cache.',
    ),
    'aliases' => array(
      'env-switch',
    ),
  );
  return $items;
}