From edf4d81bc13017a368ed7bb0521a4d8064c7542f Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Thu, 19 Sep 2013 21:17:46 -0700 Subject: [PATCH] Also support field labels in csv output. --- commands/core/outputformat/list.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/commands/core/outputformat/list.inc b/commands/core/outputformat/list.inc index e994111d44..cb56f685ab 100644 --- a/commands/core/outputformat/list.inc +++ b/commands/core/outputformat/list.inc @@ -105,6 +105,12 @@ class drush_outputformat_list extends drush_outputformat { } } + // Include field labels, if specified + if (!isset($metadata['list-item']) && is_array($input) && isset($metadata['field-labels'])) { + if (isset($metadata['include-field-labels']) && $metadata['include-field-labels']) { + array_unshift($input, $metadata['field-labels']); + } + } foreach ($input as $label => $data) { // If this output formatter is set to print a single item from each // element, select that item here.