You are here

function environment_drush_command in Environment 6

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

Implementation of hook_drush_command().

File

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

Code

function environment_drush_command() {
  $items = array();
  $items['environment-show'] = array(
    'description' => 'Show the current environment state.',
    'arguments' => array(
      'workflow' => 'Specify the workflow whose current environment state you wish to check. Leave blank for all workflows.',
    ),
    'drupal dependencies' => array(
      'environment',
    ),
    'aliases' => array(
      'env',
      'env-show',
      '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.',
    ),
    '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.',
    ),
    'aliases' => array(
      'env-switch',
    ),
  );
  return $items;
}