You are here

function hook_update_deploy_tools_drush_command in Hook Update Deploy Tools 7

Same name and namespace in other branches
  1. 8 hook_update_deploy_tools.drush.inc \hook_update_deploy_tools_drush_command()

Implements hook_drush_command().

File

./hook_update_deploy_tools.drush.inc, line 10
Drush commands for Hook Deploy Update Tools.

Code

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

  // The 'init' command.
  $items['site-deploy-init'] = array(
    'description' => dt("Creates the site_deploy module"),
    'arguments' => array(
      'directory-path' => dt('The directory path for where to create site_deploy, relative to where hook_deploy_update_tools is installed.'),
    ),
    'options' => array(),
    'examples' => array(
      'drush site-deploy-init' => dt('Creates site_deploy module in !path', array(
        '!path' => '../custom',
      )),
      'drush site-deploy-init features' => dt('Creates site_deploy module in !path', array(
        '!path' => '../features',
      )),
    ),
    'scope' => 'site',
    'aliases' => array(
      'site-deploy-init',
      'hook-update-deploy-tools-init',
    ),
  );
  $items['site-deploy-export'] = array(
    'description' => dt("Exports an exportable to an export file, saved in location defined in hook_update_deploy_tools config"),
    'arguments' => array(
      'exportable' => dt('The name type of thing to export.  Example: Rules'),
      'rule-name' => dt('The machine name of the exportable item.  Example: rules_rule_name'),
    ),
    'required-arguments' => TRUE,
    'options' => array(),
    'examples' => array(
      'drush site-deploy-export Rules rules_rule_name' => dt('Creates the export of rule "!path"', array(
        '!path' => 'rules_rule_name',
      )),
    ),
    'scope' => 'site',
    'aliases' => array(
      'site-deploy-export',
      'hook-update-deploy-tools-export',
    ),
  );
  $items['site-deploy-import'] = array(
    'description' => dt("Import an item from an export file, found in location defined in hook_update_deploy_tools config"),
    'arguments' => array(
      'importable' => dt('The name type of thing to import.  Example: Rules'),
      'item-name' => dt('The machine name of the importable item.  Example: rules_rule_name'),
    ),
    'required-arguments' => TRUE,
    'options' => array(),
    'examples' => array(
      'drush site-deploy-import Rule rules_rule_name' => dt('Imports  rule "!path"', array(
        '!path' => 'rules_rule_name',
      )),
    ),
    'scope' => 'site',
    'aliases' => array(
      'site-deploy-import',
      'hook-update-deploy-tools-import',
    ),
  );
  $items['site-deploy-n-lookup'] = array(
    'description' => dt("Returns the update_n number for a given module"),
    'arguments' => array(
      'module-name' => dt("The machine name of the module's update to lookup."),
    ),
    'required-arguments' => TRUE,
    'options' => array(),
    'examples' => array(
      'drush site-deploy-n-lookup MY_MODULE' => dt('Returns the last run hook_update_N for the module "!module".', array(
        '!module' => 'MY_MODULE',
      )),
    ),
    'scope' => 'site',
    'aliases' => array(
      'site-deploy-n-lookup',
    ),
  );
  $items['site-deploy-n-set'] = array(
    'description' => dt("Rollsback a module's last run number back one.  WARNING! Use only for development."),
    'arguments' => array(
      'module-name' => dt("The machine name of the module's update to rollback."),
      'set-to' => dt("The number of the update to set back to."),
    ),
    'required-arguments' => 1,
    'options' => array(),
    'examples' => array(
      'drush site-deploy-n-set MY_MODULE' => dt('Alters the system setting for the "!module" hook_update_n to be one less than it was.', array(
        '!module' => 'MY_MODULE',
      )),
      'drush site-deploy-n-set MY_MODULE 7005' => dt('Sets the current update number for  "!module" to 7005', array(
        '!module' => 'MY_MODULE',
      )),
    ),
    'scope' => 'site',
    'aliases' => array(
      'site-deploy-n-set',
    ),
  );
  return $items;
}