function drush_print

8.0.x drush_print($message = '', $indent = 0, $handle = NULL, $newline = TRUE)
6.x drush_print($message = '', $indent = , $handle = NULL, $newline = TRUE)
7.x drush_print($message = '', $indent = 0, $handle = NULL, $newline = TRUE)
3.x drush_print($message = '', $indent = 0)
master drush_print($message = '', $indent = 0, $handle = NULL, $newline = TRUE)

Prints a message with optional indentation. In general, drush_log($message, 'ok') is often a better choice than this function. That gets your confirmation message (for example) into the logs for this drush request. Consider that drush requests may be executed remotely and non interactively.


$message: The message to print.

$indent: The indentation (space chars)

42 calls to drush_print()
drush_choice in includes/
Ask the user to select an item from a list. From a provided associative array, drush_choice will display all of the questions, numbered from 1 to N, and return the item the user selected. "0" is always cancel; entering a blank line is also…
drush_core_cache_clear in commands/core/
Command callback for drush cache-clear.
drush_core_cli in commands/core/
drush_core_drupal_directory in commands/core/
drush_core_help in commands/core/
This is called if no command or an unknown command is entered.

... See full list


includes/, line 814
The drush API implementation and helpers.


function drush_print($message = '', $indent = 0) {
  $msg = str_repeat(' ', $indent) . (string) $message . "\n";
  if ($charset = drush_get_option('output_charset') && function_exists('iconv')) {
    $msg = iconv('UTF-8', $charset, $msg);
  print $msg;