function xkcd_drush_command

8.0.x xkcd_drush_command()
6.x xkcd_drush_command()
7.x xkcd_drush_command()
4.x xkcd_drush_command()
5.x xkcd_drush_command()
master xkcd_drush_command()

Implements hook_drush_command().

In this hook, you specify which commands your drush module makes available, what it does and description.

Notice how this structure closely resembles how you define menu hooks.

See `drush topic docs-commands` for a list of recognized keys.


examples/, line 31
Example XKCD Drush command.


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

  // The 'xkcd' command.
  $items['xkcd-fetch'] = array(
    'description' => "Retrieve and display xkcd cartoons.",
    'arguments' => array(
      'search' => 'Optional argument to retrive the cartoons matching an index number, keyword search or "random". If omitted the latest cartoon will be retrieved.',
    'options' => array(
      'image-viewer' => 'Command to use to view images (e.g. xv, firefox). Defaults to "display" (from ImageMagick).',
      'google-custom-search-api-key' => 'Google Custom Search API Key, available from Default key limited to 100 queries/day globally.',
    'examples' => array(
      'drush xkcd' => 'Retrieve and display the latest cartoon.',
      'drush xkcd sandwich' => 'Retrieve and display cartoons about sandwiches.',
      'drush xkcd 123 --image-viewer=eog' => 'Retrieve and display cartoon #123 in eog.',
      'drush xkcd random --image-viewer=firefox' => 'Retrieve and display a random cartoon in Firefox.',
    'aliases' => array('xkcd'),
    // No bootstrap at all.
    'bootstrap' => DRUSH_BOOTSTRAP_NONE,

  return $items;