function outputformat_drush_command_alter

8.0.x outputformat.drush.inc outputformat_drush_command_alter(&$command)
6.x outputformat.drush.inc outputformat_drush_command_alter(&$command)
7.x outputformat.drush.inc outputformat_drush_command_alter(&$command)
master outputformat.drush.inc outputformat_drush_command_alter(&$command)

Implements hook_drush_command_alter

File

commands/core/outputformat.drush.inc, line 243
Core drush output formats.

Code

function outputformat_drush_command_alter(&$command) {
  // In --pipe mode, change the default format to the default pipe format, or
  // to json, if no default pipe format is given.
  if (drush_get_context('DRUSH_PIPE') && (isset($command['engines']['outputformat']))) {
    $default_format = isset($command['engines']['outputformat']['pipe-format']) ? $command['engines']['outputformat']['pipe-format'] : 'json';
    $command['engines']['outputformat']['default'] = $default_format;
  }
}