function drush_help_section_formatter_options

8.0.x help.drush.inc drush_help_section_formatter_options($command, &$help_attributes)
6.x help.drush.inc drush_help_section_formatter_options($command, &$help_attributes)
7.x help.drush.inc drush_help_section_formatter_options($command, &$help_attributes)
4.x drush.inc drush_help_section_formatter_options($command, &$help_attributes)
5.x help.drush.inc drush_help_section_formatter_options($command, &$help_attributes)
master helpsingle.drush.inc drush_help_section_formatter_options($command, &$help_attributes)

The options section formatter. Adds a "--" in front of each item label. Also handles short-form and example-value components in the help attributes.

File

includes/drush.inc, line 504
The drush API implementation and helpers.

Code

function drush_help_section_formatter_options($command, &$help_attributes) {
  if ($help_attributes['label'][0] == '-') {
    drush_log(dt("Option '%option' of command %command should instead be declared as '%fixed'", array('%option' => $help_attributes['label'], '%command' => $command['command'], '%fixed' => preg_replace('/^--*/', '', $help_attributes['label']))), 'debug');
  }
  else {
    $help_attributes['label'] = '--' . $help_attributes['label'];
  }
  if (array_key_exists('example-value', $help_attributes)) {
    $help_attributes['label'] .= '=' . $help_attributes['example-value'];
    if (array_key_exists('short-form', $help_attributes)) {
      $help_attributes['short-form'] .= ' ' . $help_attributes['example-value'];
    }
  }
  if (array_key_exists('short-form', $help_attributes)) {
    $help_attributes['label'] = '-' . $help_attributes['short-form'] . ', ' . $help_attributes['label'];
  }
  drush_help_section_default_formatter($command, $help_attributes);
}