function drush_complete_rebuild_arguments

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

Rebuild and cache completions for command arguments.


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/
Retrieves from cache, or generates a listing of completion candidates of a specific type (and optionally, command).


includes/, line 501
Provide completion output for shells.


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.
  $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,
  return $complete['commands'][$command]['arguments'];