function pm_drush_command

8.0.x pm.drush.inc pm_drush_command()
6.x pm.drush.inc pm_drush_command()
7.x pm.drush.inc pm_drush_command()
3.x pm.drush.inc pm_drush_command()
4.x pm.drush.inc pm_drush_command()
5.x pm.drush.inc pm_drush_command()
master pm.drush.inc pm_drush_command()

Implementation of hook_drush_command().

File

commands/pm/pm.drush.inc, line 86
The drush Package Manager

Code

function pm_drush_command() {
  $update = 'update';
  if (drush_drupal_major_version() == 5) {
    $update = 'update_status';
  }
  $engines = array(
    'engines' => array(
      'version_control' => 'Integration with VCS in order to easily commit your changes to projects.',
      'package_handler' => 'Determine how to download/checkout new projects and acquire updates to projects.',
    ),
  );

  $items['pm-enable'] = array(
    'description' => 'Enable one or more modules or themes.',
    'arguments' => array(
      'modules' => 'A space delimited list of modules or themes. You can use the * wildcard at the end of module and theme names to to enable all matches.',
    ),
    'aliases' => array('en'),
    'deprecated-aliases' => array('enable'),
  );
  $items['pm-disable'] = array(
    'description' => 'Disable one or more modules or themes.',
    'arguments' => array(
      'modules' => 'A space delimited list of modules or themes. You can use the * wildcard at the end of module and theme names to disable multiple matches.',
    ),
    'aliases' => array('dis'),
    'deprecated-aliases' => array('disable'),
  );
  $items['pm-info'] = array(
    'description' => 'Show info for one or more projects.',
    'arguments' => array(
      'projects' => 'A space delimited list of projects. You can use the * wildcard at the end of module names to get info for the project and all its sub projects.',
    ),
  );
  // Install command is reserved for the download and enable of projects including dependencies.
  // @see http://drupal.org/node/112692 for more information.
  // $items['install'] = array(
  //     'description' => 'Download and enable one or more modules',
  //   );
  $items['pm-uninstall'] = array(
    'description' => 'Uninstall one or more modules.',
    'arguments' => array(
      'modules' => 'A space delimited list of modules.',
    ),
    'deprecated-aliases' => array('uninstall'),
  );
  $items['pm-list'] = array(
    'description' => 'Show a list of available modules and themes',
    'callback arguments' => array(array(), FALSE),
    'options' => array(
      '--type' => 'Filter by project type. Choices: module, theme.',
      '--status' => 'Filter by project status. Choices: enabled,disable and/or \'not installed\'. You can use multiple comma separated values. (i.e. --status="disabled,not installed").',
      '--package' => 'Filter by project packages. You can use multiple comma separated values. (i.e. --package="Core - required,Other").',
      '--pipe' => 'Returns a space delimited list of the names of the resulting projects.',
    ),
    'aliases' => array('sm'),
    'deprecated-aliases' => array('statusmodules'),
  );
  $items['pm-refresh'] = array(
    'description' => 'Refresh update status information',
    'drupal dependencies' => array($update),
    'aliases' => array('rf'),
    'deprecated-aliases' => array('refresh'),
  );
  $items['pm-updatecode'] = array(
    'description' => 'Update your project code',
    'drupal dependencies' => array($update),
    'arguments' => array(
      'projects' => 'Optional. A space delimited list of installed projects (modules or themes) to update.',
    ),
    'options' => array(
      '--backup-dir' => 'Specify a directory to backup packages into, defaults to a backup directory within your Drupal root.',
      '--pipe' => 'Returns a space delimited list of enabled modules and their respective version and update information, one module per line. Order: module name, current version, recommended version, update status.',
    ),
    'aliases' => array('upc'),
    'deprecated-aliases' => array('updatecode'),
  ) + $engines;

  // Merge help from above.
  $items['pm-update'] = array_merge($items['pm-updatecode'], array(
    'description' => 'Update your project code and apply any database updates required (update.php)',
    'aliases' => array('up'),
    'deprecated-aliases' => array('update'),
  ));

  $items['pm-releases'] = array(
    'description' => 'Release information for a project',
    'drupal dependencies' => array($update),
    'arguments' => array(
      'projects' => 'A space separated list of drupal.org project names.',
    ),
    'examples' => array(
      'drush pm-releases cck zen' => 'View releases for cck and Zen projects.',
    ),
    'deprecated-aliases' => array('info'),
  );
  $items['pm-download'] = array(
    'description' => 'Download core Drupal and projects like CCK, Zen, etc.',
    'examples' => array(
      'drush dl' => 'Download latest version of Drupal core.',
      'drush dl drupal' => 'Download latest stable version of Drupal core',
      'drush dl drupal-7.x' => 'Download latest 7.x development version of Drupal core',
      'drush dl cck zen es' => 'Download latest versions of CCK, Zen and Spanish translations for my version of Drupal.',
      'drush dl og-1.3' => 'Download a specfic version of Organic groups module for my version of Drupal.',
      'drush dl diff-6.x-2.x' => 'Download a specific development branch of diff module for a specific Drupal version.',
    ),
    'arguments' => array(
      'projects' => 'A space separated list of project names, with optional version. Defaults to \'drupal\'',
    ),
    'options' => array(
      '--destination' => 'Path to which the project will be copied.',
      '--source' => 'The base URL which provides project release history in XML. Defaults to http://updates.drupal.org/release-history.',
      '--variant' => "Only useful for install profiles. Possible values: 'core', 'no-core', 'make'.",
      '--drupal-project-rename' => 'Alternate name for "drupal" directory when downloading drupal project.',
    ),
    'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, // No bootstrap at all.
    'aliases' => array('dl'),
    'deprecated-aliases' => array('download'),
  ) + $engines;
  return $items;
}