Skip to content

Commit

Permalink
Also support field labels in csv output.
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson committed Sep 20, 2013
1 parent 51251b5 commit edf4d81
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions commands/core/outputformat/list.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit edf4d81

Please sign in to comment.