function drush_sandwich_spreads_status

8.0.x sandwich.drush.inc drush_sandwich_spreads_status()
6.x sandwich.drush.inc drush_sandwich_spreads_status()
7.x sandwich.drush.inc drush_sandwich_spreads_status()
master sandwich.drush.inc drush_sandwich_spreads_status()

Implements drush_hook_COMMAND().

This ficticious command shows how a deep array can be constructed and used as a command return value that can be output by different output formatters.

File

examples/sandwich.drush.inc, line 269
Example drush command.

Code

function drush_sandwich_spreads_status() {
  return array(
    'ketchup' => array(
      'name' => 'Ketchup',
      'description' => 'Some say its a vegetable, but we know its a sweet spread.',
      'available' => '7',
      'taste' => 'sweet',
    ),
    'mayonnaise' => array(
      'name' => 'Mayonnaise',
      'description' => 'A nice dairy-free spead.',
      'available' => '12',
      'taste' => 'creamy',
    ),
    'mustard' => array(
      'name' => 'Mustard',
      'description' => 'Pardon me, but could you please pass that plastic yellow bottle?',
      'available' => '8',
      'taste' => 'tangy',
    ),
    'pickles' => array(
      'name' => 'Pickles',
      'description' => 'A necessary part of any sandwich that does not taste terrible.',
      'available' => '63',
      'taste' => 'tasty',
    ),
  );
}