'example_callback', // a short description of your command 'description' => "Drush example command. It doesn't to a lot", ); // more commands here ... return $items; } /** * Implementation of hook_drush_help(). * * This function is called whenever a drush user calls * 'drush help ' * * @param * A string with the help section (prepend with 'drush:') * * @return * A string with the help text for your command. */ function example_drush_help($section) { switch ($section) { case 'drush:example': return dt("Prints the amount of time since january 1st, 1970, in years and weeks."); } } /** * Example drush command callback. * * This is where the action takes place. * * In this function, all of Drupals API is (usually) available, including * any functions you have added in your own modules/themes. * * To print something to the terminal window, use drush_print(). * */ function example_callback() { $commands = func_get_args(); // Using the Drupal API function 'format_interval()' // and Drush API function 'drush_print' drush_print(format_interval(time())); }