You are here

patch_manager.drush.inc in Patch manager 6

Same filename and directory in other branches
  1. 7 patch_manager.drush.inc

File

patch_manager.drush.inc
View source
<?php

/**
 * Implementation of hook_drush_command().
 */
function patch_manager_drush_command() {
  $items = array();
  $items['patch-list'] = array(
    'callback' => 'patch_manager_command_list',
    'description' => 'List all patches that patch manager knows about.',
    'arguments' => array(),
    'aliases' => array(),
    'options' => array(),
    'examples' => array(),
  );
  return $items;
}

/**
 * Implementation of hook_drush_help().
 */
function patch_manager_drush_help($section) {
  switch ($section) {
    case 'drush:pm-list':
      return dt('List all patches that patch manager knows about.');
  }
}

/**
 * Patch manager command: list patches
 */
function patch_manager_command_list() {
  $res = db_query('SELECT nid, title FROM {node} WHERE type="patch"');
  $rows = array();
  while ($node = db_fetch_object($res)) {
    $rows[] = array(
      $node->nid,
      $node->title,
    );
  }
  $header = array(
    t('#'),
    t('Title'),
  );
  $tbl = new Console_Table(CONSOLE_TABLE_ALIGN_LEFT, '');
  $out = $tbl
    ->fromArray($header, $rows);
  drush_print($out);
}

Functions

Namesort descending Description
patch_manager_command_list Patch manager command: list patches
patch_manager_drush_command Implementation of hook_drush_command().
patch_manager_drush_help Implementation of hook_drush_help().