function drush_complete_rebuild_arguments

8.0.x complete.inc drush_complete_rebuild_arguments($command)
6.x complete.inc drush_complete_rebuild_arguments($command)
7.x complete.inc drush_complete_rebuild_arguments($command)
5.x complete.inc drush_complete_rebuild_arguments($command)
master complete.inc drush_complete_rebuild_arguments($command)

Rebuild and cache completions for command arguments.

Parameters

string $command: A specific command to retrieve and cache arguments for.

Return value

array Structured array of candidate completion arguments, keyed by the command.

1 call to drush_complete_rebuild_arguments()
drush_complete_get in includes/complete.inc
Retrieves from cache, or generates a listing of completion candidates of a specific type (and optionally, command).

File

includes/complete.inc, line 459
Provide completion output for shells.

Code

function drush_complete_rebuild_arguments($command) {
  // Bootstrap to the site level (if possible) - commands may need to check
  // the bootstrap level, and perhaps bootstrap higher in extraordinary cases.
  drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_SITE);
  $commands = drush_get_commands();
  $hook = str_replace("-", "_", $commands[$command]['command-hook']);
  $result = drush_command_invoke_all($hook . '_complete');
  if (isset($result['values'])) {
    // We add a space following all completes. Eventually there may be some
    // items (e.g. comma separated arguments) where we don't add a space.
    array_walk($result['values'], 'drush_complete_trailing_space');
  }

  $complete = array(
    'commands' => array(
      $command => array(
        'arguments' => $result,
      ),
    ),
  );
  drush_complete_cache_set($complete);
  return $complete['commands'][$command]['arguments'];
}