function _drush_prepare_command

8.0.x command.inc _drush_prepare_command(&$command, $arguments = array())
6.x command.inc _drush_prepare_command(&$command, $arguments = array())
7.x command.inc _drush_prepare_command(&$command, $arguments = array())
4.x command.inc _drush_prepare_command(&$command, $arguments = array())
5.x command.inc _drush_prepare_command(&$command, $arguments = array())
master command.inc _drush_prepare_command(&$command, $arguments = array())

Called by drush_parse_command(). If a command is dispatched directly by drush_dispatch(), then drush_dispatch() will call this function.

2 calls to _drush_prepare_command()
drush_dispatch in includes/command.inc
Given a command record, dispatch it as if it were the original command. Executes in the currently bootstrapped site using the current option contexts. Note that drush_dispatch will not bootstrap any further than the current command has already…
drush_parse_command in includes/command.inc
Matches a commands array, as returned by drush_get_arguments, with the current command table.

File

includes/command.inc, line 1359
The drush command engine.

Code

function _drush_prepare_command(&$command, $arguments = array()) {
  // Drush overloads $command['arguments']; save the argument description
  if (!isset($command['argument-description'])) {
    $command['argument-description'] = $command['arguments'];
  }
  // Merge specified callback arguments, which precede the arguments passed on the command line.
  if (isset($command['callback arguments']) && is_array($command['callback arguments'])) {
    $arguments = array_merge($command['callback arguments'], $arguments);
  }
  $command['arguments'] = $arguments;
}