function drush_format_help_section

8.0.x drush_format_help_section($command, $section)
6.x drush_format_help_section($command, $section)
7.x drush_format_help_section($command, $section)
4.x drush_format_help_section($command, $section)
5.x drush_format_help_section($command, $section)
master drush_format_help_section($command, $section)

Format one named help section from a command record

@returns array Formatted rows, suitable for printing via drush_print_table.


$command: A command record with help information

$section: The name of the section to format ('options', 'topic', etc.)

3 calls to drush_format_help_section()
drush_core_global_options in commands/core/
drush_help_html_global_options in commands/core/
drush_print_help in commands/core/
Print the help for a single command to the screen.


commands/core/, line 128


function drush_format_help_section($command, $section) {
  $formatter = (function_exists('drush_help_section_formatter_' . $section)) ? 'drush_help_section_formatter_' . $section : 'drush_help_section_default_formatter';
  foreach ($command[$section] as $name => $help_attributes) {
    if (!is_array($help_attributes)) {
      $help_attributes = array('description' => $help_attributes);
    $help_attributes['label'] = $name;
    call_user_func_array($formatter, array($command, &$help_attributes));
    if (!array_key_exists('hidden', $help_attributes)) {
      $rows[] = array($help_attributes['label'], $help_attributes['description']);
      // Process the subsections too, if any
      if (!empty($command['sub-' . $section]) && array_key_exists($name, $command['sub-' . $section])) {
        $rows = array_merge($rows, _drush_format_help_subsection($command, $section, $name, $formatter));
  return $rows;