You are here

function redirect_drush_command in Redirect 7

Same name and namespace in other branches
  1. 8 redirect.drush.inc \redirect_drush_command()
  2. 7.2 redirect.drush.inc \redirect_drush_command()

Implementation of hook_drush_command().

File

./redirect.drush.inc, line 11
Drush integration for the redirect module.

Code

function redirect_drush_command() {
  $items = array();
  $items['generate-redirects'] = array(
    'description' => 'Create redirects.',
    'drupal dependencies' => array(
      'devel_generate',
    ),
    'arguments' => array(
      'count' => 'Number of redirects to generate.',
    ),
    'options' => array(
      'delete' => 'Delete all redirects before generating new ones.',
    ),
  );
  $items['create-redirect'] = array(
    'description' => 'Create a redirect.',
    'arguments' => array(
      'source' => 'Path from which to redirect.',
      'destination' => 'Path or URL to which to redirect.',
    ),
    'options' => array(
      'language' => 'The language for which to redirect. Defaults to all.',
      'code' => "Redirect code, one of 30{0-7}, or 0 for the module's configured default. Defaults to 0.",
    ),
    'examples' => array(
      "drush create-redirect 'source' 'destination'" => 'Add a redirect from source to destination.',
      "drush create-redirect 'source' 'destination' --language=fr --code=302" => 'Add a 302 redirect from source to destination for the French language.',
    ),
  );
  return $items;
}