function drush_help_html

8.0.x help.drush.inc drush_help_html($commands)
6.x help.drush.inc drush_help_html($commands)
7.x help.drush.inc drush_help_html($commands)
3.x core.drush.inc drush_help_html()
4.x help.drush.inc drush_help_html($commands)
5.x help.drush.inc drush_help_html($commands)

Return an HTML page documenting all available commands and global options.

1 call to drush_help_html()
drush_core_help in commands/core/core.drush.inc
This is called if no command or an unknown command is entered.

File

commands/core/core.drush.inc, line 310
Core drush commands.

Code

function drush_help_html() {
  foreach (drush_get_commands() as $key => $command) {
    // Get rid of aliases in command list.
    if (empty($command['is_alias']) && !$command['hidden']) {
      $commands[$key] = $command;
    }
  }
  unset($commands['help']);

  $output = "<html><head><title>drush help</title><style>dt {font-size: 110%; font-weight: bold}</style></head><body>\n";

  // Command table
  $output .= '<h3>Command list</h3><table>';
  foreach ($commands as $key => $command) {
    $output .= "<tr><td><a href=\"#$key\">$key</a></td><td>" . $command['description'] . "</td></tr>\n";
  }
  $output .= "</table>\n";

  // Global options
  $options = drush_get_option_help();
  $output .= '<h3>Global Options</h3><table>';
  foreach ($options as $key => $value) {
    $output .= "<tr><td>$key</td><td>" . $value . "</td></tr>\n";
  }
  $output .= "</table>\n";

  // Command details
  $output .= '<h3>Command detail</h3><dl>';
  foreach ($commands as $key => $command) {
    $output .= "\n<a name=\"$key\"></a><dt>$key</dt><dd><pre>\n";
    ob_start();
    drush_show_help(array($key));
    $output .= ob_get_clean();
    $output .= "</pre></dd>\n";
  }

  $output .= "</body></html>\n";

  return $output;
}