function sandwich_drush_command

8.0.x sandwich_drush_command()
6.x sandwich_drush_command()
7.x sandwich_drush_command()
3.x sandwich_drush_command()
4.x sandwich_drush_command()
5.x sandwich_drush_command()
master sandwich_drush_command()

Implementation of 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_parse_command() for a list of recognized keys.

Return value

An associative array describing your command(s).


examples/, line 34
Example drush command.


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

  $items['make-me-a-sandwich'] = array(
    'description' => "Makes a delicious sandwich.",
    'arguments' => array(
      'filling' => 'The type of the sandwich (turkey, cheese, etc.)',
    'options' => array(
      'spreads' => 'Comma delimited list of spreads (e.g. mayonnaise, mustard)',
    'examples' => array(
      'drush make-me-a-sandwich turkey --spreads=ketchup,mustard',
    'aliases' => array('mmas'),
    'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, // No bootstrap at all.

  return $items;