function drush_sandwich_sandwiches_served

8.0.x drush_sandwich_sandwiches_served()
6.x drush_sandwich_sandwiches_served()
7.x drush_sandwich_sandwiches_served()
master drush_sandwich_sandwiches_served()

Implements drush_hook_COMMAND().

Demonstrates how to return a simple value that is transformed by the selected formatter to display either with a label (using the key-value formatter) or as the raw value itself (using the string formatter).

1 call to drush_sandwich_sandwiches_served()


examples/, line 250
Example drush command.


function drush_sandwich_sandwiches_served() {
  $served = 0;
  $served_object = drush_cache_get(drush_get_cid('sandwiches-served'));
  if ($served_object) {
    $served = $served_object->data;
  // In the default format, key-value, this return value
  // will print " Sandwiches Served    :  1".  In the default pipe
  // format, only the array value ("1") is returned.
  return $served;