druplicon.drush.inc

  1. 8.0.x commands/core/druplicon.drush.inc
  2. 6.x commands/core/druplicon.drush.inc
  3. 7.x commands/core/druplicon.drush.inc

Show Druplicon ASCII art at the end of any request which has --druplicon on it.

Functions

File

commands/core/druplicon.drush.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Show Druplicon ASCII art at the end of any request which has --druplicon on it.
  5. */
  6. /**
  7. * Implements hook_drush_help_alter().
  8. */
  9. function druplicon_drush_help_alter(&$command) {
  10. if ($command['command'] == 'global-options' && $command['#brief'] === FALSE) {
  11. $command['options']['druplicon'] = 'Shows the druplicon as glorious ASCII art.';
  12. }
  13. }
  14. /**
  15. * Implements hook_drush_exit().
  16. */
  17. function druplicon_drush_exit() {
  18. if (drush_get_option('druplicon')) {
  19. $misc_dir = realpath(dirname(__FILE__)) . '/../../misc';
  20. if (drush_get_context('DRUSH_NOCOLOR')) {
  21. $content = file_get_contents($misc_dir . '/druplicon-no_color.txt');
  22. }
  23. else {
  24. $content = file_get_contents($misc_dir . '/druplicon-color.txt');
  25. }
  26. drush_print($content);
  27. }
  28. }