function _drush_help_merge_subcommand_information

8.0.x help.drush.inc _drush_help_merge_subcommand_information(&$command)
6.x help.drush.inc _drush_help_merge_subcommand_information(&$command)
7.x help.drush.inc _drush_help_merge_subcommand_information(&$command)
5.x help.drush.inc _drush_help_merge_subcommand_information(&$command)
master helpsingle.drush.inc _drush_help_merge_subcommand_information(&$command)

Check to see if the specified command contains an 'allow-additional-options' record. If it does, find the additional options that are allowed, and add in the help text for the options of all of the sub-commands.

1 call to _drush_help_merge_subcommand_information()
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 183

Code

function _drush_help_merge_subcommand_information(&$command) {
  // 'allow-additional-options' will either be FALSE (default),
  // TRUE ("allow anything"), or an array that lists subcommands
  // that are or may be called via drush_invoke by this command.
  if (is_array($command['allow-additional-options'])) {
    $implemented = drush_get_commands();
    foreach ($command['allow-additional-options'] as $subcommand_name) {
      if (array_key_exists($subcommand_name, $implemented)) {
        $command['options'] += $implemented[$subcommand_name]['options'];
        $command['sub-options'] = array_merge_recursive($command['sub-options'], $implemented[$subcommand_name]['sub-options']);
        if (empty($command['arguments'])) {
          $command['arguments'] = $implemented[$subcommand_name]['arguments'];
        }
        $command['topics'] = array_merge($command['topics'], $implemented[$subcommand_name]['topics']);
      }
    }
  }
}