4 * Output formatter 'string'
7 * The render data may be either a string or an array
8 * string - printed as-is, without quotes
9 * array - the value of the first item in the array is printed as-is
11 * 'label' - If present, prints "label: " prior to the data
15 * return DRUSH_VERSION;
17 * Output with --format=string:
21 class drush_outputformat_string extends drush_outputformat {
22 function format($data, $metadata) {
23 // If the data is an array, print the value of the first item.
24 if (is_array($data)) {
25 if (count($data) > 1) {
26 return $this->format_error("Multiple rows provided where only one is allowed.");
31 if (is_array($data)) {
32 return $this->format_error("Array provided where a string is required.");