function drush_outputformat_csv_or_string::format

8.0.x csv_or_string.inc drush_outputformat_csv_or_string::format($data, $metadata)
6.x csv_or_string.inc drush_outputformat_csv_or_string::format($data, $metadata)
7.x csv_or_string.inc drush_outputformat_csv_or_string::format($data, $metadata)
master csv_or_string.inc drush_outputformat_csv_or_string::format($data, $metadata)

Overrides drush_outputformat::format

File

commands/core/outputformat/csv_or_string.inc, line 14

Class

drush_outputformat_csv_or_string
Output formatter 'csv-or-string'

Code

function format($data, $metadata) {
  // If the data is an array, print it as a comma-separated list
  if (is_array($data)) {
    return drush_format($data, $metadata, 'csv');
  }
  return (string) $data;
}