Very simple but working drush extension? I want to implement my own Drush command, and struggle because while the "Make me a sandwich" example is very good, it's also quite complex, and for someone that has never made such an extension it's easy to loose track of what is mandatory, and what is optional.

I would like to see a basic Drush extension implementation.
This is valid for Drush >= 4

&lt;?php
/**
 * @file EXAMPLE.drush.inc
 * Provides a simple drush extension example
 */

function EXAMPLE_drush_command() {
  return array('COMMANDNAME' =&gt;
    array(
      'description' =&gt; 'My example command',
      'bootstrap' =&gt; DRUSH_BOOTSTRAP_DRUSH,
    ),
  );
}

function drush_COMMANDNAME_validate() {
  // Return
  // drush_set_error('MACHINE_NAME_OF_FAIL', dt('Command failed because [reason]'));
  // on error.
}

function drush_COMMANDNAME() {
  echo 'Extension working!';
}