Skip to content

Commit

Permalink
Only add field labels to list formats that explicitly request them.
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson committed Sep 20, 2013
1 parent edf4d81 commit 69220f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions commands/core/outputformat.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ function outputformat_drush_engine_outputformat() {
'machine-parsable' => TRUE,
'engine-class' => 'list',
'list-item-type' => 'nested-csv',
'labeled-list' => TRUE,
'description' => 'A list of values, one per row, each of which is a comma-separated list of values.',
'engine-capabilities' => array('format-table'),
'topic-example' => array(array('a', 12, '[email protected]'),array('b', 17, '[email protected]')),
Expand Down
2 changes: 1 addition & 1 deletion commands/core/outputformat/list.inc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ 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['list-item']) && isset($metadata['labeled-list']) && is_array($input) && isset($metadata['field-labels'])) {
if (isset($metadata['include-field-labels']) && $metadata['include-field-labels']) {
array_unshift($input, $metadata['field-labels']);
}
Expand Down

0 comments on commit 69220f4

Please sign in to comment.