function drush_print

8.0.x output.inc drush_print($message = '', $indent = 0, $handle = NULL, $newline = TRUE)
6.x output.inc drush_print($message = '', $indent = , $handle = NULL, $newline = TRUE)
7.x output.inc drush_print($message = '', $indent = 0, $handle = NULL, $newline = TRUE)
3.x drush.inc drush_print($message = '', $indent = 0)
master output.inc 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.

Parameters

$message: The message to print.

$indent: The indentation (space chars)

42 calls to drush_print()
drush_choice in includes/drush.inc
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/clear.cache.inc
Command callback for drush cache-clear.
drush_core_cli in commands/core/core.drush.inc
drush_core_drupal_directory in commands/core/core.drush.inc
drush_core_help in commands/core/core.drush.inc
This is called if no command or an unknown command is entered.

... See full list

File

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

Code

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;
}