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'] = [
  12. 'description' => 'Shows the druplicon as glorious ASCII art.',
  13. ];
  14. }
  15. }
  16. /**
  17. * Implements hook_drush_exit().
  18. */
  19. function druplicon_drush_exit() {
  20. if (drush_get_option('druplicon')) {
  21. $misc_dir = DRUSH_BASE_PATH . '/misc';
  22. if (drush_get_context('DRUSH_NOCOLOR')) {
  23. $content = file_get_contents($misc_dir . '/druplicon-no_color.txt');
  24. }
  25. else {
  26. $content = file_get_contents($misc_dir . '/druplicon-color.txt');
  27. }
  28. drush_print($content);
  29. }
  30. }