function annotationcommand_adapter_alter_option_description_fields

master annotationcommand_adapter.inc annotationcommand_adapter_alter_option_description_fields($option_help, $commandinfo, $default)

TODO: Document

File

includes/annotationcommand_adapter.inc, line 772
annotationcommand_adapter.inc

Code

function annotationcommand_adapter_alter_option_description_fields($option_help, $commandinfo, $default) {
  $formatOptions = new FormatterOptions($commandinfo->getAnnotations()->getArrayCopy());
  $field_labels = $formatOptions->get(FormatterOptions::FIELD_LABELS, [], '');
  $default_fields = $formatOptions->get(FormatterOptions::DEFAULT_FIELDS, [], array_keys($field_labels));
  $available_fields = array_keys($field_labels);
  // @todo silencing a notice that will likely be fixed on views-list fixes https://github.com/consolidation/output-formatters/issues/35
  $option_help['example-value'] = @implode(', ', $default_fields);
  $option_help['description'] = dt('Fields to output. All available fields are: !available.', array('!available' => implode(', ', $available_fields)));
  return $option_help;
}