function _drush_format_help_subsection

8.0.x _drush_format_help_subsection($command, $section, $subsection, $formatter, $prefix = ' ')
6.x _drush_format_help_subsection($command, $section, $subsection, $formatter, $prefix = ' ')
7.x _drush_format_help_subsection($command, $section, $subsection, $formatter, $prefix = ' ')
4.x _drush_format_help_subsection($command, $section, $subsection, $formatter, $prefix = ' ')
5.x _drush_format_help_subsection($command, $section, $subsection, $formatter, $prefix = ' ')
master _drush_format_help_subsection($command, $section, $subsection, $formatter, $prefix = ' ')

Format one named portion of a subsection from a command record. Subsections allow related parts of a help record to be grouped together. For example, in the 'options' section, sub-options that are related to a particular primary option are stored in a 'sub-options' section whose name == the name of the primary option.

@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.)

$subsection: The name of the subsection (e.g. the name of the primary option)

$formatter: The name of a function to use to format the rows of the subsection

$prefix: Characters to prefix to the front of the label (for indentation)

1 call to _drush_format_help_subsection()
drush_format_help_section in commands/core/
Format one named help section from a command record


commands/core/, line 253


function _drush_format_help_subsection($command, $section, $subsection, $formatter, $prefix = '  ') {
  $rows = array();
  foreach ($command['sub-' . $section][$subsection] 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(
        'label' => $prefix . $help_attributes['label'],
        'description' => $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, $prefix . '  '));
  return $rows;