function _drush_help_sort_command_options

8.0.x help.drush.inc _drush_help_sort_command_options($a, $b)
6.x help.drush.inc _drush_help_sort_command_options($a, $b)
7.x help.drush.inc _drush_help_sort_command_options($a, $b)
5.x help.drush.inc _drush_help_sort_command_options($a, $b)
master helpsingle.drush.inc _drush_help_sort_command_options($a, $b)

Sort command options alphabetically. Engine options at the end.

1 string reference to '_drush_help_sort_command_options'
drush_print_help in commands/core/help.drush.inc
Print the help for a single command to the screen.

File

commands/core/help.drush.inc, line 80

Code

function _drush_help_sort_command_options($a, $b) {
  $engine_a = strpos($a, '=');
  $engine_b = strpos($b, '=');
  if ($engine_a && !$engine_b) {
    return 1;
  }
  else if (!$engine_a && $engine_b) {
    return -1;
  }
  elseif ($engine_a && $engine_b) {
    if (substr($a, 0, $engine_a) == substr($b, 0, $engine_b)) {
      return 0;
    }
  }
  return ($a < $b) ? -1 : 1;
}